Abstract
The grammatical knowledge of language models (LMs) is often measured using a benchmark of linguistic minimal pairs, where LMs are presented with a pair of acceptable and unacceptable sentences and required to judge which is acceptable. The existing dominant approach, however, naively calculates and compares the probabilities of paired sentences using LMs. Additionally, large language models (LLMs) have yet to be thoroughly examined in this field. We thus investigate how to make the most of LLMs' grammatical knowledge to comprehensively evaluate it. Through extensive experiments of nine judgment methods in English and Chinese, we demonstrate that a probability readout method, in-template LP, and a prompting-based method, Yes/No probability computing, achieve particularly high performance, surpassing the conventional approach. Our analysis reveals their different strengths, e.g., Yes/No probability computing is robust against token-length bias, suggesting that they harness different aspects of LLMs' grammatical knowledge. Consequently, we recommend using diverse judgment methods to evaluate LLMs comprehensively.
Introduction
Modern Large Language Models (LLMs) have evolved from simple next-token predictors into sophisticated instruction-followers. However, measuring their fundamental linguistic competence—specifically their grammatical knowledge—remains a challenge. Traditionally, researchers have relied on "acceptability judgments" using minimal pairs: two sentences that differ by only one grammatical feature (e.g., "The cat sits" vs. "The cat sit"). The model is expected to assign a higher probability to the correct sentence.
Recent studies suggest that this "raw probability" approach might underestimate LLMs. Because these models are instruction-tuned for helpfulness, they might penalize a grammatical sentence simply because it is an unlikely conversational turn. This paper explores whether more sophisticated "readout" methods can better extract the grammatical knowledge latent within these models.
Methodology: Beyond Raw Probabilities
The researchers evaluated nine different judgment methods across eight state-of-the-art LLMs, including Llama-3, Mixtral, and Qwen2. Two novel approaches emerged as significantly superior to the status quo:
1. In-template Log Probability (LP)
Instead of evaluating a sentence in isolation, this method wraps it in a descriptive template: "The following sentence is grammatically acceptable: [Sentence]." By calculating the log probability of the entire string, the model is "primed" to focus on the grammatical nature of the text rather than its conversational likelihood.
2. Yes/No Probability Computing
This prompting-based method asks the model a direct question: "Is the following sentence grammatically acceptable? Respond with Yes or No." Rather than relying on the model's generated text, researchers analyze the "logits" (internal scores) for the tokens "Yes" and "No." A normalized score is then used to compare the sentences in a minimal pair.
Experimental Setup
The study utilized two major "Minimal Pair" (MP) benchmarks:
- BLiMP (Benchmark of Linguistic Minimal Pairs): The standard for English, containing 67,000 pairs across 12 linguistic phenomena.
- CLiMP: A Chinese counterpart covering 16,000 pairs.
These benchmarks allow for a direct measurement of grammatical knowledge without requiring task-specific fine-tuning.
Key Insights
Mitigating Length Bias
A significant flaw in traditional probability methods is "length bias"—LLMs often prefer shorter sentences regardless of grammar. The Yes/No probability method effectively neutralizes this bias because it compares the scores of "Yes" and "No" for the same sentence, rather than comparing two different sentences of potentially different lengths.
Prompting as a Diagnostic Lens
The results demonstrate that prompting is more than just a way to generate text; it acts as a lens that focuses the model's internal knowledge. By using specific templates, researchers can guide the model to prioritize syntactic rules over semantic or conversational patterns.
Complementary Strengths
Different methods appear to tap into different aspects of the model's "brain." For instance, the Yes/No method excels at identifying subject-verb agreement, while In-template LP is more effective at detecting ellipsis (missing words). This suggests that a diverse set of evaluation methods is necessary for a comprehensive assessment.
Results
The findings indicate that LLMs possess more grammatical knowledge than previously thought:
- Surpassing Human Benchmarks: On the English BLiMP benchmark, top models like Llama-3-Instruct and Qwen2 exceeded the average human accuracy of 88.6% when using these optimized methods.
- Ensemble Performance: By combining predictions from multiple methods (Voting Ensembles), the researchers achieved a new state-of-the-art score of 90.2% with Qwen2.
- Cross-Linguistic Consistency: The In-template LP method consistently outperformed conventional approaches in both English and Chinese.
Limitations and Future Directions
While LLMs are approaching human-level performance on these benchmarks, specific weaknesses remain:
- Word-Shuffling: Models often fail to detect errors when a sentence is simply a scrambled version of a valid one, suggesting a lingering "bag-of-words" bias.
- Syntactic Attractors: Complex sentences with "distractor" nouns (e.g., "The sisters who met Cheryl bake...") still cause confusion in agreement tasks.
- Form vs. Meaning: Models may struggle to distinguish between grammatical form and semantic sense (e.g., "Colorless green ideas sleep furiously"). Future work should focus on instructing models to isolate syntactic form from semantic plausibility.
Conclusion
To accurately measure the linguistic capabilities of modern LLMs, we must move beyond naive probability checks. By employing instruction-aware methods like In-template LP and Yes/No probability computing, researchers can more effectively unlock and evaluate the deep grammatical knowledge these models possess.
Summary updated