Hero diagram

Paper: 2605.05197 Authors: Yingshan Susan Wang, Linlu Qiu, Zhaofeng Wu, Roger P. Levy, Yoon Kim Categories: cs.CL

The Gap

Language models generate grammatical text and distinguish grammatical from ungrammatical sentences in minimal pairs. But their string probabilities don’t cleanly separate grammatical from ungrammatical sentences overall. Prior work assumed that if LMs don’t show grammaticality in their output probabilities, they don’t represent it internally. This paper challenges that assumption: maybe grammaticality lives in the hidden layers, not the probability distribution.

Problem: LM probabilities blur grammaticality
         (grammatical sentences can have low P, ungrammatical can have high P)
           |
           v
Assumption: Grammaticality ≠ likelihood in human language
            Maybe LMs learn this distinction internally?
           |
           v
Method: Train linear probe on hidden states
        (grammatical vs synthetic ungrammatical sentences)
           |
           v
Evidence: Probe generalizes to human benchmarks
          Outperforms string probability
          Works cross-lingually
          Weakly correlates with probability
           |
           v
Conclusion: LMs acquire implicit grammaticality representation
            distinct from string probability

The Increment

One sentence: Before this paper, we judged LM grammatical knowledge by output probabilities; after, we know grammaticality is encoded in hidden layers and can be extracted with simple probes.

Core Mechanism

The method has three components: a synthetic ungrammatical dataset, a linear probe, and a generalization test. First, they create ungrammatical sentences by applying rule-based perturbations to naturalistic text (swap word order, delete articles, violate agreement). Second, they train a linear classifier on LM hidden states to distinguish grammatical from ungrammatical sentences. Third, they test whether this probe generalizes to human-curated grammaticality benchmarks it never saw during training.

Naturalistic corpus
      |
      v
[Perturbation rules] ---> Synthetic ungrammatical sentences
      |                              |
      v                              v
Grammatical sentences          Ungrammatical sentences
      |                              |
      +------------------------------+
                    |
                    v
            [Language Model]
                    |
                    v
            Hidden states (h)
                    |
                    v
        [Linear probe: w·h + b]
                    |
                    v
        Grammaticality score
                    |
                    v
    Test on human benchmarks (BLiMP, etc.)

Think of the LM as a factory inspector examining products on a conveyor belt. The inspector has two jobs: estimate how common each product is (string probability) and check if it meets quality standards (grammaticality). Prior work only looked at the inspector’s frequency estimates. This paper discovered the inspector keeps internal quality notes in a logbook (hidden states). By training a simple decoder (linear probe) to read those notes, they can extract the quality judgment directly, which turns out to be more accurate than inferring quality from frequency alone. The key insight: the logbook exists and is readable, even though the inspector doesn’t explicitly publish quality scores.

Key Concepts

  • Linear probe: A simple classifier (just multiplication and addition) trained to predict a property from a model’s internal representations. If a linear probe can extract information, it means that information is explicitly represented in the hidden states, not buried in complex nonlinear patterns. It’s like checking if a book’s index can help you find a topic—if yes, the topic is well-organized in the text.

  • Synthetic ungrammatical data: Sentences created by applying rule-based perturbations to real text (e.g., “The cat sit on mat” from “The cat sits on the mat”). This is cheaper than human annotation but risks creating artifacts—patterns that distinguish synthetic errors from real grammatical sentences but don’t reflect true grammaticality. The test of quality: does a probe trained on synthetic data generalize to human-curated benchmarks?

  • Grammaticality vs likelihood: In human language, a sentence can be grammatically perfect but unlikely (“Colorless green ideas sleep furiously”) or grammatically broken but predictable in context. LMs trained on likelihood might conflate these. The question: do LMs learn to separate them internally, even if their output probabilities don’t?

Framework Shift

Before (mainstream approach):        After (this paper):

LM output probabilities              LM hidden states
        |                                   |
        v                                   v
P(sentence) as proxy            [Linear probe]
for grammaticality                      |
        |                               v
        v                    Explicit grammaticality
Conflates frequency              representation
and grammaticality                      |
                                        v
                              Generalizes cross-lingually
                              Outperforms P(sentence)

From treating probability as the only window into LM knowledge to recognizing that internal representations encode distinctions not visible in output distributions, the core shift is: LMs are not just probability estimators—they’re structured representers.

Expert Assessment

Problem choice: Real gap. The disconnect between LM probabilities and human grammaticality judgments has been a known issue, but most work either accepted it or tried to fix probabilities. Asking whether grammaticality is represented internally but not surfaced is a natural next question that hadn’t been systematically explored.

Method maturity: Elegant simplicity. Linear probes are the right tool here—if grammaticality is linearly separable in hidden states, it’s a strong signal. The synthetic perturbation approach is pragmatic but introduces risk: the probe might learn to detect perturbation artifacts rather than grammaticality. The cross-lingual and human-benchmark generalization tests partially address this, but I’d want to see ablations on perturbation types.

Experimental integrity: Baselines are fair. The comparison to string probability is the right one. The cross-lingual results are impressive and suggest the probe isn’t just overfitting to English-specific patterns. One concern: the probe is trained on synthetic data and tested on human benchmarks, which is good for generalization but makes it hard to know the probe’s ceiling. What’s the human agreement on these benchmarks?

Writing quality: Clear and well-structured. The introduction sets up the problem crisply. The results section could be tighter—some tables feel redundant. The discussion of semantic plausibility (where the probe fails) is honest and important but could be expanded. If I were revising, I’d add a section on failure modes and probe interpretability.

Verdict: strong accept — Challenges a core assumption about how LMs represent linguistic knowledge, with clean experiments and honest reporting of limitations.

Takeaways

  • Probing as diagnostic: When a model’s outputs don’t reflect a distinction you care about, check if the distinction exists in hidden states. Linear probes are cheap to train and can reveal what the model knows but doesn’t say.

  • Synthetic data for probing: You can bootstrap probe training with rule-based perturbations, but validate generalization on human-curated data. The gap between synthetic and real is where you learn whether you’re measuring the right thing.

  • Cross-lingual transfer as validation: If a probe trained on one language works on others, it’s evidence you’re capturing something fundamental rather than surface patterns. This is a useful sanity check for any representation learning claim.

论文: 2605.05197 作者: Yingshan Susan Wang, Linlu Qiu, Zhaofeng Wu, Roger P. Levy, Yoon Kim 分类: cs.CL

缺口

语言模型能生成合乎语法的文本,也能在最小对比对中区分合法和非法句子。

但它们的字符串概率并不能整体上清晰地分开合法和非法句子。

先前工作假设:如果语言模型的输出概率中看不到语法性,那它们内部也没有表征语法性。

本文挑战这个假设:也许语法性存在于隐藏层中,而非概率分布里。

问题:语言模型概率模糊了语法性
     (合法句子可能低概率,非法句子可能高概率)
           |
           v
假设:人类语言中 语法性 ≠ 似然
     也许语言模型在内部学到了这种区分?
           |
           v
方法:在隐藏状态上训练线性探针
     (合法 vs 合成的非法句子)
           |
           v
证据:探针泛化到人类基准
     超越字符串概率
     跨语言有效
     与概率弱相关
           |
           v
结论:语言模型习得了独立于字符串概率的
     隐式语法性表征

增量

一句话: 这篇论文之前,我们用输出概率判断语言模型的语法知识;之后,我们知道语法性编码在隐藏层中,可以用简单探针提取。

核心机制

方法有三个组件:合成非法数据集、线性探针、泛化测试。

首先,他们通过对自然文本应用基于规则的扰动来创建非法句子(交换词序、删除冠词、违反一致性)。

其次,他们在语言模型隐藏状态上训练线性分类器,区分合法和非法句子。

第三,他们测试这个探针是否能泛化到训练时从未见过的人类标注语法性基准。

自然语料库
      |
      v
[扰动规则] ---> 合成非法句子
      |                |
      v                v
合法句子          非法句子
      |                |
      +----------------+
            |
            v
      [语言模型]
            |
            v
      隐藏状态 (h)
            |
            v
  [线性探针: w·h + b]
            |
            v
      语法性分数
            |
            v
在人类基准上测试 (BLiMP 等)

把语言模型想象成传送带上检查产品的质检员。

质检员有两项工作:估计每种产品有多常见(字符串概率)和检查是否符合质量标准(语法性)。

先前工作只看质检员的频率估计。

本文发现质检员在记事本(隐藏状态)里保留了内部质量笔记。

通过训练一个简单的解码器(线性探针)来读取这些笔记,他们可以直接提取质量判断,结果比从频率推断质量更准确。

关键洞察:记事本存在且可读,尽管质检员不明确发布质量分数。

关键概念

  • 线性探针: 一个简单分类器(只有乘法和加法),训练来从模型内部表征预测某个属性。

如果线性探针能提取信息,说明这个信息在隐藏状态中是显式表征的,而非埋在复杂的非线性模式里。

就像检查一本书的索引能否帮你找到某个主题——如果可以,说明这个主题在文本中组织得很好。

  • 合成非法数据: 通过对真实文本应用基于规则的扰动创建的句子(例如从”The cat sits on the mat”变成”The cat sit on mat”)。

这比人工标注便宜,但有制造伪影的风险——区分合成错误和真实合法句子的模式可能不反映真正的语法性。

质量测试:在合成数据上训练的探针能否泛化到人类标注的基准?

  • 语法性 vs 似然: 在人类语言中,一个句子可以语法完美但不太可能(“无色的绿色想法愤怒地睡觉”),或者语法破碎但在上下文中可预测。

在似然上训练的语言模型可能混淆这两者。

问题是:语言模型是否在内部学会分离它们,即使输出概率没有体现?

框架转变

之前(主流方法):              之后(本文方法):

语言模型输出概率                语言模型隐藏状态
        |                             |
        v                             v
P(句子) 作为                    [线性探针]
语法性的代理                          |
        |                             v
        v                      显式语法性表征
混淆频率和语法性                      |
                                      v
                          跨语言泛化
                          超越 P(句子)

从把概率当作窥探语言模型知识的唯一窗口,到认识到内部表征编码了输出分布中不可见的区分,核心转变是:语言模型不只是概率估计器——它们是结构化表征器

专家评审

选题眼光: 真实缺口。

语言模型概率与人类语法性判断之间的脱节是已知问题,但大多数工作要么接受它,要么试图修正概率。

问语法性是否在内部表征但未浮现是一个自然的后续问题,此前没有被系统探索过。

方法成熟度: 优雅简洁。

线性探针是正确的工具——如果语法性在隐藏状态中线性可分,这是一个强信号。

合成扰动方法务实但引入风险:探针可能学会检测扰动伪影而非语法性。

跨语言和人类基准泛化测试部分解决了这个问题,但我想看到对扰动类型的消融实验。

实验诚意: 基线公平。

与字符串概率的比较是正确的。

跨语言结果令人印象深刻,表明探针不只是过拟合英语特定模式。

一个担忧:探针在合成数据上训练,在人类基准上测试,这对泛化有利,但难以知道探针的上限。

这些基准上的人类一致性是多少?

写作功力: 清晰且结构良好。

引言部分简洁地设定了问题。

结果部分可以更紧凑——有些表格感觉冗余。

对语义合理性(探针失败的地方)的讨论诚实且重要,但可以扩展。

如果我来修改,我会加一节关于失败模式和探针可解释性的内容。

判决: 强接收 — 挑战了关于语言模型如何表征语言知识的核心假设,实验干净,诚实报告局限性。

要点总结

  • 探针作为诊断工具: 当模型输出没有反映你关心的区分时,检查这个区分是否存在于隐藏状态中。

线性探针训练成本低,可以揭示模型知道但不说的东西。

  • 用合成数据做探针: 你可以用基于规则的扰动来引导探针训练,但要在人类标注数据上验证泛化。

合成和真实之间的差距是你了解自己是否在测量正确事物的地方。

  • 跨语言迁移作为验证: 如果在一种语言上训练的探针在其他语言上有效,这是你在捕捉基本东西而非表面模式的证据。

这对任何表征学习声明都是有用的合理性检查。