Large Language Models Naively Recover Ethnicity from Individual Records
Organizations: PhD Candidate, Department of Government, Harvard University
Abstract
I demonstrate that large language models can infer ethnicity from names with accuracy exceeding that of Bayesian Improved Surname Geocoding (BISG) without additional training data, enabling inference outside the United States and to contextually appropriate classification categories. Using stratified samples from Florida and North Carolina voter files with self-reported race, LLM-based classification achieves up to 84.7% accuracy, outperforming BISG (68.2%) on balanced samples. I test six models including Gemini 3 Flash, GPT-4o, and open-source alternatives such as DeepSeek v3.2 and GLM-4.7. Enabling extended reasoning can improve accuracy by 1-3 percentage points, though effects vary across contexts; including metadata such as party registration reaches 86.7%. LLM classification also reduces the income bias inherent in BISG, where minorities in wealthier neighborhoods are systematically misclassified as White. I further validate using Lebanese voter registration with religious sect (64.3% accuracy), Indian MPs from reserved constituencies (99.2%), and Indian land records with caste classification (74.0%). Aggregate validation across India, Uganda, Nepal, Armenia, Chile, and Costa Rica using original full-count voter rolls demonstrates that the method recovers known population distributions where naming conventions are distinctive. For large-scale applications, small transformer models fine-tuned on LLM labels exceed BISG accuracy while enabling local deployment at no cost.
Figures & tables
| Florida | North Carolina | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | Gem. | 4o | 4.1-m | DS | 4.7 | 4.7F | Gem. | 4o | 4.1-m | DS | 4.7 | 4.7F |
| Full name + geo | 83.8 | 78.5 | 70.5 | 76.2 | 74.5 | 62.3 | 83.5 | 80.5 | 74.1 | 78.4 | 77.9 | 72.3 |
| Full name only | 82.8 | 78.2 | 69.7 | 71.2 | 75.0 | 70.7 | 82.3 | 79.6 | 72.9 | 73.6 | 77.2 | 73.7 |
| Surname + geo | 76.0 | 69.9 | 65.9 | 67.7 | 61.8 | 58.0 | 74.3 | 69.0 | 66.8 | 68.1 | 63.6 | 59.7 |
| Surname only | 69.7 | 64.7 | 58.4 | 63.7 | 60.4 | 59.0 | 68.3 | 64.5 | 60.6 | 64.4 | 61.6 | 60.7 |
| BISG (surname + geo) | 68.2 | 68.9 | ||||||||||
| Florida | North Carolina | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Race | Gem. | 4o | 4.1-m | DS | 4.7 | 4.7F | BISG | Gem. | 4o | 4.1-m | DS | 4.7 | 4.7F | BISG |
| White | 88.4 | 88.5 | 90.6 | 88.7 | 90.9 | 70.1 | 86.8 | 84.4 | 88.2 | 90.5 | 89.6 | 86.4 | 83.5 | 85.0 |
| Black | 81.7 | 72.2 | 48.9 | 61.4 | 59.3 | 43.1 | 48.8 | 80.0 | 68.3 | 52.1 | 59.3 | 66.4 | 60.6 | 53.1 |
| Hispanic | 92.3 | 91.6 | 91.4 | 92.6 | 90.3 | 94.9 | 88.8 | 84.9 | 85.7 | 83.8 | 85.6 | 81.6 | 78.4 | 77.0 |
| Asian | 72.8 | 61.6 | 51.2 | 62.4 | 57.3 | 40.5 | 48.5 | 84.5 | 79.6 | 70.2 | 79.4 | 77.4 | 67.4 | 60.5 |
| Average | 83.8 | 78.5 | 70.5 | 76.3 | 74.5 | 62.3 | 68.2 | 83.5 | 80.5 | 74.2 | 78.5 | 78.0 | 72.3 | 68.9 |
| Method | Gem. | 4o | DS | GLM-4.7 | 4.7F |
|---|---|---|---|---|---|
| LLM (full name + city) | 90.4 | 88.3 | 82.6 | 82.8 | 60.0 |
| LLM (full name only) | 81.4 | 83.0 | 72.9 | 76.4 | 80.5 |
| Lee & Velez benchmarks: | |||||
| Hybrid (image+name) | 88.8 | ||||
| fBISG | 85.4 | ||||
| BISG | 84.5 | ||||
| Sect | Gem. | 4o | 4.1-mini | DS | 4.7 | 4.7F |
|---|---|---|---|---|---|---|
| Armenian Orthodox | 97.4 | 95.6 | 73.4 | 64.0 | 81.4 | 15.4 |
| Shia | 86.4 | 90.4 | 81.0 | 76.8 | 78.0 | 70.4 |
| Maronite | 77.0 | 71.6 | 34.6 | 62.0 | 66.8 | 66.2 |
| Sunni | 76.8 | 54.0 | 82.2 | 81.6 | 74.6 | 55.4 |
| Druze | 55.2 | 45.8 | 26.8 | 5.6 | 6.0 | 0.2 |
| Roman Orthodox | 45.2 | 14.0 | 5.8 | 10.6 | 19.2 | 0.0 |
| Category | Gem. | 4o | DS | GLM-4.7 | 4.7F |
|---|---|---|---|---|---|
| Scheduled Caste (SC) | 98.8 | 94.0 | 50.6 | 88.0 | 98.8 |
| Scheduled Tribe (ST) | 100.0 | 87.2 | 91.5 | 85.1 | 29.8 |
| Overall | 99.2 | 91.5 | 65.4 | 86.9 | 73.8 |
| Gemini 3 Flash | DeepSeek v3.2 | GLM-4.7 | ||||
|---|---|---|---|---|---|---|
| Category | Sarpanch | Bihar | Sarpanch | Bihar | Sarpanch | Bihar |
| Scheduled Caste (SC) | 48.0 | 97.3 | 42.7 | 74.7 | 4.0 | 56.0 |
| Scheduled Tribe (ST) | 72.0 | 58.7 | 57.3 | 30.7 | 73.3 | 52.0 |
| Other Backward Class (OBC) | 57.3 | 60.0 | 60.0 | 78.7 | 18.7 | 25.3 |
| General (unreserved) | 50.7 | 80.0 | 40.0 | 37.3 | 85.3 | 92.0 |
| Overall | 57.0 | 74.0 | 50.0 | 55.3 | 45.3 | 56.3 |
| Country | Category | Census | Gem. | 4o | DS | GLM-4.7 | 4.7F | Err. |
|---|---|---|---|---|---|---|---|---|
| India | Hindu | 79.8 | 80.2 | 81.0 | 78.6 | 79.0 | 82.0 | 0.4 |
| India | Muslim | 14.2 | 13.9 | 13.1 | 12.0 | 13.2 | 9.5 | 0.3 |
| India | Christian | 2.3 | 2.1 | 0.8 | 1.0 | 2.4 | 2.1 | 0.1 |
| India | Sikh | 1.7 | 2.2 | 3.0 | 2.8 | 3.6 | 2.4 | 0.5 |
| India | Buddhist | 0.7 | 0.2 | 0.2 | 0.0 | 0.2 | 0.1 | 0.5 |
| India | Jain | 0.4 | 0.3 | 0.4 | 0.9 | 0.2 | 0.3 | 0.1 |
| Input Configuration | Accuracy | vs. Baseline |
|---|---|---|
| BISG (surname + county) | 79.8% | 4.9pp |
| Name + County (baseline) | 84.7% | — |
| Name + County + Age | 85.0% | +0.3pp |
| Name + County + Party | 86.7% | +2.0pp |
| Name + Zip Code | 84.7% | 0.0pp |
| Name + County + Gender | 84.0% | 0.7pp |
| Model | Dataset | Teacher | Base | Fine-tuned | Gap |
|---|---|---|---|---|---|
| Qwen3-4B | Florida | 83.3% | 72.0% | 78.7% | -4.7pp |
| Qwen3-1.7B | Florida | 83.3% | 60.3% | 79.7% | -3.7pp |
| Qwen3-0.6B | Florida | 83.3% | 7.3% | 75.7% | -7.7pp |
| Qwen3-4B | North Carolina | 71.7% | 63.7% | 68.0% | -3.7pp |
| Qwen3-1.7B | North Carolina | 71.7% | 64.0% | 67.7% | -4.0pp |
| Qwen3-0.6B | North Carolina | 71.7% | 18.0% | 68.0% | -3.7pp |
| Florida | North Carolina | ||||
| Model | Reasoning | Accuracy | Gain | Accuracy | Gain |
| Gemini 3 Flash | Minimal | 83.7% | — | 82.3% | — |
| Gemini 3 Flash | High | 84.7% | +1.0pp | 82.0% | 0.3pp |
| Gemini 3 Pro | High | 83.3% | — | 79.3% | — |
| Qwen 3 235B | Off | 72.3% | — | 77.0% | — |
| Qwen 3 235B | On | 74.3% | +2.0pp | 75.7% | 1.3pp |
LLM Inference
Large language model inference studies how models generate outputs efficiently, reliably, and securely across hardware and workloads.
See all 267 papers