Skip to content

Linear representations of grammaticality in neural language models

Jul 2026 · arXiv.org · Vol abs/2607.15175 · 0 citations · 64 references
Computer Science

TL;DR

The results provide evidence that grammaticality is robustly encoded in sentence representations of a wide range of pretrained NLMs, yielding clear representational separation on the dimension of grammaticality that cannot be fully explained by alternative sentence-level factors.

Abstract

Whether neural language models (NLMs) possess the ability to distinguish strings on the basis of their grammaticality remains a debated topic in the computational linguistics literature. Existing evidence has largely relied on probability-based measures, testing whether models assign higher probabilities to grammatical than ungrammatical strings. However, probability comparisons have been criticized as a measure for grammatical knowledge based on the assumption that grammaticality is inherently entangled with likelihood. Model-assigned probability is a function of many related sentence properties, such as lexical frequency, plausibility, and world knowledge. In this work, we move beyond probability-based evaluations and investigate whether grammaticality is encoded in the internal representations of NLMs. Using mass-mean probing, we test whether grammatical and ungrammatical sentences are systematically separated in representational space. We further examine the extent to which these representations are independent of sentence properties that are correlated with grammaticality, as well as their generalization across grammatical phenomena and languages. Our results provide evidence that grammaticality is robustly encoded in sentence representations of a wide range of pretrained NLMs, yielding clear representational separation on the dimension of grammaticality that cannot be fully explained by alternative sentence-level factors. Moreover, this encoding generalizes across a broad range of grammatical phenomena and to some degree, across languages, suggesting that grammaticality constitutes a coherent representational dimension in contemporary NLMs. These findings contribute new evidence to debates about the nature of syntactic knowledge in language models and offer a complementary framework for evaluating grammatical competence that is not dependent on string probabilities alone.

View source

Similar papers

Review Open access Jul 2026

Large Language Models as Distributional Baselines for Language Tasks

The central contributions of this paper articulate the conditions under which distributional predictability threatens the internal validity of an experiment and provide concrete recommendations for how to control for this potential confound.

Sean Trott, James A. Michaelov, Cameron R. Jones et al. · 0 citations

Exposure is Optional: Learning Unlike Coordination in Language Models

Analysis of internal representations indicate that language models process unlike coordination by treating the conjoined elements as belonging to similar structural categories or through a mechanism akin to deletion, both of which appear learnable from exposure to alike coordination alone.

Jiamu Luo, Shane Steinert-Threlkeld · 0 citations
Preprint Aug 2026

Language Models Generalize to Human-like Word Order Preferences

These findings demonstrate that LMs can recover human-like linguistic generalizations from impoverished input and provide a controlled framework for investigating the mechanisms underlying such biases.

Amanda Popadich, Shane Steinert-Threlkeld · 0 citations
Preprint Aug 2026

Rethinking and formalising the state across languages: a unified computational learning theory account

It is suggested that the state is a systemic, context-dependent morphosyntactic mechanism that selects grammatical templates across synthetic languages and constitutes one instance of a broader class of syntactically conditioned dependencies that also includes agreement and grammatical case.

M. E. Idrissi · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.