TL;DR
Large Language Models (LLMs) possess deep grammatical knowledge that standard probability-based metrics often fail to capture. By using "in-template" probability readouts and "Yes/No" probability computing, researchers can significantly improve the accuracy of LLM acceptability judgments, even surpassing human benchmarks on English linguistic tests.
What Problem Does This Paper Address?
How do we know if an LLM actually "understands" grammar? The standard way to test this is through minimal pairs: two sentences that differ by only one grammatical feature (e.g., "The cat sits" vs. "*The cat sit"). Traditionally, researchers simply compared the raw log-probabilities (LP) the model assigned to each sentence, assuming the "better" sentence would have a higher probability.
However, modern LLMs are instruction-tuned and RLHF-aligned. They are designed to follow prompts, not just predict the next token in a vacuum. This paper argues that raw probabilities are a "noisy" signal that doesn't fully reflect an LLM's internal grammatical knowledge. The authors set out to find better ways to "elicit" these judgments through smarter prompting and readout techniques.
Methods
The authors compared nine different methods across three categories:
- Sentence Probability Readout (Standard): Directly calculating the probability of the sentence tokens. This includes length-normalized versions like MeanLP and PenLP.
- In-template Probability Readout (Novel): Instead of just the sentence, they embed it in a template like: "The following sentence is grammatically acceptable: [Sentence]." They then calculate the probability of the entire string. This provides the model with context about the task it's performing.
- Prompt-based Methods:
- A/B Prompting: Asking the model to choose which of two sentences is better.
- Yes/No Probability Computing: Asking the model if a single sentence is acceptable and then calculating the normalized probability of the tokens "Yes" vs. "No."
To ensure fair results, they used constrained decoding (via the outlines library) for A/B prompting to prevent the model from outputting irrelevant text.
Datasets
The study utilized two major minimal-pair benchmarks:
- BLiMP (Benchmark of Linguistic Minimal Pairs): The gold standard for English, containing 67,000 pairs covering 67 different linguistic paradigms (e.g., subject-verb agreement, island effects).
- CLiMP: A similar benchmark for Chinese, consisting of 16,000 pairs across 16 paradigms.
They tested these methods across eight state-of-the-art models, including Llama-3, Mixtral, Qwen2, and Yi-1.5.
Key Insights and Ideas
- Prompting is NOT ineffective: Previous studies suggested that prompting LLMs for grammar was worse than raw probability. This paper proves that with the right technique—specifically Yes/No probability computing—prompting is actually superior for English benchmarks.
- Robustness to Length Bias: Standard probability methods are notoriously biased toward shorter sentences. The authors found that Yes/No prob comp is remarkably robust to differences in token length between the two sentences in a pair.
- Complementary Strengths: Different methods excel at different things. For example, Yes/No prob comp is great at subject-verb agreement, while In-template LP is better at identifying ellipsis errors. This suggests they access different "pockets" of the model's knowledge.
- The "Word-Shuffling" Weakness: All models struggled significantly with "word-shuffling" paradigms—where the unacceptable sentence is just a scrambled version of the acceptable one. This suggests LLMs may still be somewhat insensitive to exact word order, a known limitation of the Transformer architecture.
Key Results
- Surpassing Humans: On the English BLiMP benchmark, an ensemble of the top methods using Qwen2 achieved 90.2% accuracy, outperforming the human baseline of 88.6%.
- In-template LP Wins in Chinese: For the CLiMP benchmark, In-template LP consistently provided the highest accuracy across all models.
- Ensembling is King: The best results overall came from ensembling (voting) between In-template LP and Yes/No probability computing, proving that these methods are indeed complementary.
Limitations and Future Work
- Nonsensical Sentences: Some benchmark sentences are grammatically perfect but semantically weird (e.g., "All convertibles weren't there existing"). Models often flag these as "unacceptable" because they are confusing, not because they are ungrammatical. Future work could use prompts that explicitly tell the model to ignore meaning and focus only on form.
- Language Diversity: The study was limited to English and Chinese. Expanding to morphologically rich languages (like Slavic or Semitic languages) would provide a tougher test for these methods.
- Word Order: The failure on word-shuffling paradigms remains a major challenge for future architectural or prompting improvements.
Summary updated