Temporal Text Classification with Large Language Models
Organizations: George Mason University, Fairfax, VA, USA
Abstract
Languages change over time. Computational models can be trained to recognize such changes enabling them to estimate the publication date of texts. Despite recent advancements in Large Language Models (LLMs), their performance on automatic dating of texts, also known as Temporal Text Classification (TTC), has not been explored. This study provides the first systematic evaluation of leading proprietary (Claude 3.5, GPT-4o, Gemini 1.5) and open-source (LLaMA 3.2, Gemma 2, Mistral, Nemotron 4) LLMs on TTC using three historical corpora, two in English and one in Portuguese. We test zero-shot and few-shot prompting, and fine-tuning settings. Our results indicate that proprietary models perform well, especially with few-shot prompting. They also indicate that fine-tuning substantially improves open-source models but that they still fail to match the performance delivered by proprietary LLMs.
Figures & tables
| Dataset | Lang | Time Span | Size | Classes |
|---|---|---|---|---|
| Colonia | PT | 16th–20th C. | >5M Tokens | 5 (100 year) |
| CLMET | EN | 1710–1920 | 34M Words | 3 (70 year) |
| DTE | EN | 1700–2010 | Varies by Split | 4 Intervals* |
| Model | Type | Param. |
| Claude 3.5 Sonnet | Proprietary | - |
| GPT-4o | Proprietary | - |
| Gemini 1.5 Pro | Proprietary | - |
| LLaMA 3.1 | Open-Source | 8B |
| Gemma 2 | Open-Source | 9B |
| Mistral | Open-Source | 7B |
| Dataset | SVM | Length | Zero-Shot/Few-Shot (5-Shot) | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Claude | GPT4o | Gemini | LLaMA | Gemma | Mistral | Nemotron | |||
| Colonia | .51 | 10 | .35/.45 | .50/ .61 | .39/.50 | .12/.11 | .18/.25 | .17/.24 | .16/.23 |
| .65 | 50 | .72 / .88 | .68 / .72 | .59/.64 | .20/.35 | .28/.38 | .27/.37 | .25/.34 | |
| .69 | 100 | .68/ .91 | .71 / .96 | .77 / .82 | .26/.22 | .36/.51 | .34/.49 | .33/.45 | |
| CLMET | .70 | 10 | .48/.58 | .52/.48 | .41/.40 | .14/.18 | .17/.26 | .18/.23 | .16/.25 |
| .77 | 50 | .60/.62 | .73/ .85 | .63/.67 | .21/.27 | .26/.39 | .27/.34 | .23/.37 | |
| Model | Colonia | CLMET | DTE | |
|---|---|---|---|---|
| LLaMA 3.2 | 0.61 | 0.65 | 0.66 | +0.29 |
| Gemma 2 | 0.73 | 0.75 | 0.78 | +0.23 |
| Mistral | 0.72 | 0.68 | 0.76 | +0.24 |
| Nemotron 4B | 0.70 | 0.67 | 0.71 | +0.23 |
| Dataset | LLaMA | Gemma | Mistral | Nemotron | ||||
|---|---|---|---|---|---|---|---|---|
| Colonia | .21/.31/.70 | .47/.46/.83 | .29/.58/.67 | .24/.52/.62 | ||||
| CLMET | .35/.29/.74 | .25/.62/.70 | .39/.35/.79 | .38/.44/.60 | ||||
| DTE | .27/.57/.55 | .42/.41/.84 | .30/.59/.70 | .18/.53/.83 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Field | Content |
|---|---|
| Instruction | Classify the following text into one of the given temporal classes: {class_list}. Respond with only the class label. |
| Input (Colonia) | “O aggregado foi despedindo os escravos e a fazenda; vendeo tres molecoens e huma negrinha; desfez-se das melhores joias da mulher; comeu os alugueis de tres predios; empenhou a prata” |
| Output | 1800s |
| Input (CLMET) | “The village lay in a hollow, which was, perhaps, one reason for its dullness; and the church, standing on higher ground, overlooked it with a certain air of superiority” |
| Output | 1850-1920 |
| Input (DTE) | “We have cabled the English house from which we get it and expect a reply to-morrow.” |
Text Classification
Text classification assigns text to categories such as topic, sentiment, intent, stance, or risk, supporting search, moderation, and decisions.
See all 224 papers