Towards a Science and Mathematics of Language�Models
Sophie Hao
MOL 18
8.17.2025
ChatGPT (2022)
P A R T 0 : I N T R O D U C T I O N
2
ChatGPT (2022)
P A R T 0 : I N T R O D U C T I O N
3
The Language of LLMs
In this talk, I argue that large language models (LLMs) are the first mainstream technology with a “language” that…
P A R T 0 : I N T R O D U C T I O N
4
The Language of LLMs
Unlike human language, LLM language…
P A R T 0 : I N T R O D U C T I O N
5
If we are to understand the language of LLMs, we need to develop a linguistics of LLMs.
THESIS OF THIS TALK�LLMs have a “language” of their own, �which resembles human language, �albeit with fundamental differences.
P A R T 0 : I N T R O D U C T I O N
6
AI Interpretability
I work in interpretability and explainability for deep neural models used in natural language processing (NLP).
P A R T 0 : I N T R O D U C T I O N
7
Towards LLM Linguistics
There is no consensus on what interpretability is. My position is that interpretability is LLM linguistics—a science and mathematics of LLM language.
P A R T 0 : I N T R O D U C T I O N
8
NLP and LLMs
A Brief Introduction
P A R T 0 1
Natural Language Processing
NLP is the branch of AI that deals with computer processing of human language text.
P A R T 1 : N L P A N D L L M S
10
Example: Sentiment analysis pipeline
P A R T 1 : N L P A N D L L M S
'i just saw this movie on a local tv station (tv8\'s "big chuck and little john")'
↓�['i', 'Ġjust', 'Ġsaw', 'Ġthis', 'Ġmovie', 'Ġon', 'Ġa', 'Ġlocal', 'Ġtv', 'Ġstation', 'Ġ(', 'tv', '8', "'s", 'Ġ"', 'big', 'Ġchuck', 'Ġand', 'Ġlittle', 'Ġjohn', '")']
↓�[72, 655, 2497, 428, 3807, 319, 257, 1957, 31557, 4429, 357, 14981, …]
↓�{'positive': 1.307, 'negative': 1.215}
11
Deep Learning
Current approaches to NLP are based on deep learning.
P A R T 1 : N L P A N D L L M S
12
Example: Bag of words model
P A R T 1 : N L P A N D L L M S
OUTPUT
INPUT
…
…
INTERMEDIATE
13
Deep learning represents tokens using uninterpreted features.
INTERPRETED�FEATURES
UNINTERPRETED�FEATURES
P A R T 1 : N L P A N D L L M S
14
There is a unique feature vector for each token in the vocabulary.
INTERPRETED�FEATURES
UNINTERPRETED�FEATURES
P A R T 1 : N L P A N D L L M S
15
Feature vectors are trained (i.e., fit) along with regression weights.
INTERPRETED�FEATURES
UNINTERPRETED�FEATURES
P A R T 1 : N L P A N D L L M S
16
The current state of the art in NLP is the Transformer architecture.�(Vaswani et al., 2017)
P A R T 1 : N L P A N D L L M S
INPUT
INTERMEDIATE
OUTPUT
…
…
…
17
Transformers have several layers of intermediate representations.
P A R T 1 : N L P A N D L L M S
INTERMEDIATE 1
INTERMEDIATE 2
INTERMEDIATE 3
…
…
…
⋮
⋮
18
Language Modeling
Given a sequence of tokens from a document, a language model (LM) predicts the next token in that document.
P A R T 1 : N L P A N D L L M S
19
During training, Transformer LMs make all possible predictions in parallel.
P A R T 1 : N L P A N D L L M S
INPUT
INTERMEDIATE
OUTPUT
…
…
…
…
20
This makes it very efficient to train Transformers on very large datasets.
P A R T 1 : N L P A N D L L M S
INPUT
INTERMEDIATE
OUTPUT
…
…
…
…
21
However, Transformer text generation is slow because the input grows in size.
P A R T 1 : N L P A N D L L M S
INPUT
INTERMEDIATE
OUTPUT
…
…
…
…
22
Moreover, Transformers are (arguably) not a realistic model of language.
P A R T 1 : N L P A N D L L M S
INPUT
INTERMEDIATE
OUTPUT
…
…
…
…
23
LLMs as General AI Models
What is the most likely continuation of the following?
P A R T 1 : N L P A N D L L M S
24
Why LLM Linguistics?
What is the most likely continuation of the following?
P A R T 1 : N L P A N D L L M S
25
Description
of LLM Language
P A R T 0 2
Descriptive LLM Linguistics
Descriptive linguists describe the structure of human languages.
P A R T 2 : D E S C R I P T I O N
27
Descriptive Methods
Descriptive linguists use a combination of corpus and field methods.
P A R T 2 : D E S C R I P T I O N
28
Field methods don’t work with LLMs! �(Hu and Levy, 2023)
P A R T 2 : D E S C R I P T I O N
29
LLM Field Methods
An LLM can tell you the probability that it will generate a certain text.
We can use these probabilities to access an LLM’s linguistic knowledge.
P A R T 2 : D E S C R I P T I O N
30
Syntactic Contrasts
Which sentence is an LLM more likely to generate?
Minimal pair tests show that LLM English replicates many syntactic contrasts of human English. �(Linzen et al., 2016; Marvin and Linzen, 2018; Gauthier et al., 2020; Warstadt et al., 2020; etc.)
P A R T 2 : D E S C R I P T I O N
31
LLM Acceptability Judgments
Is there such a thing as an “LLM acceptability judgment”?
P A R T 2 : D E S C R I P T I O N
32
Probability vs. Acceptability
Does probability reflect acceptability? No.
Dataset: 1,450 English sentences from Linguistic Inquiry (Sprouse et al., 2013)
LLM: OPT 175B (Zhang et al., 2022)
“Probability” refers to log probabilities.
P A R T 2 : D E S C R I P T I O N
33
Why Not?
According to Lau et al. (2017), language model probabilities are influenced by the following factors, which do not apply to acceptability:
P A R T 2 : D E S C R I P T I O N
34
MORCELA Model
In Tjuatja et al. (2025), I propose the MORCELA model:
where
P A R T 2 : D E S C R I P T I O N
35
MORCELA Model
In Tjuatja et al. (2025), I propose the MORCELA model:
where
P A R T 2 : D E S C R I P T I O N
36
MORCELA Model
In Tjuatja et al. (2025), I propose the MORCELA model:
where
P A R T 2 : D E S C R I P T I O N
37
MORCELA Model
In Tjuatja et al. (2025), I propose the MORCELA model:
where
P A R T 2 : D E S C R I P T I O N
38
MORCELA Model
In Tjuatja et al. (2025), I propose the MORCELA model:
where
P A R T 2 : D E S C R I P T I O N
39
Co-creators of MORCELA
Lindia Tjuatja
CMU CS
Graham Neubig
CMU CS
Tal Linzen
NYU Ling/DS
Sophie Hao
BU Ling/DS�NYU DS
40
Evaluating MORCELA
MORCELA scores have a high correlation with gradient acceptability judgments.
Dataset: 1,450 English sentences from Linguistic Inquiry (Sprouse et al., 2013)
LLM: OPT 175B (Zhang et al., 2022)
“Probability” refers to log probabilities.
P A R T 2 : D E S C R I P T I O N
41
Predicting Rare Words
LLMs that better predict acceptability via MORCELA have lower values of β.
These LLMs are better at predicting rare words in context.
LLMs: Pythia (Biderman et al., 2023)
P A R T 2 : D E S C R I P T I O N
42
Part 2 Conclusion
Descriptive LLM linguistics involves comparing LLM language to human language…
P A R T 2 : D E S C R I P T I O N
43
Grammar
in LLM Linguistics
P A R T 0 3
LLM Grammar
Linguists think of grammar as containing:
What are the representations and rules of LLM grammar?
P A R T 3 : G R A M M A R
45
Can we interpret an LLM’s uninterpreted features?
INTERPRETED�FEATURES
UNINTERPRETED�FEATURES
P A R T 3 : G R A M M A R
46
LLM Features
LLM feature bundles are known to contain features representing…
P A R T 3 : G R A M M A R
47
To find features, we look for groups of words that are linearly separable.�(Bolukbasi et al., 2016; Dufter and Schütze, 2019; Ravfogel et al., 2020; etc.)
she
woman
sister
mother
queen
hen
he
man
brother
father
king
rooster
actress
actor
P A R T 3 : G R A M M A R
48
To find features, we look for groups of words that are linearly separable.�(Bolukbasi et al., 2016; Dufter and Schütze, 2019; Ravfogel et al., 2020; etc.)
woman
she
sister
mother
queen
hen
he
man
brother
father
king
rooster
actress
actor
P A R T 3 : G R A M M A R
49
It is also possible to find continuously-valued features.�(Hao, 2022)
a
I
an
in
cat
bird
elephant
butterfly
rabbit
cow
woodpecker
whale
dog
crane
pelican
P A R T 3 : G R A M M A R
50
What happens if you edit a feature value?
plane
car
bike
ship
train
bus
cars
bikes
trucks
planes
ships
buses
truck
trains
P A R T 3 : G R A M M A R
51
What happens if you edit a feature value?
plane
car
bike
train
bus
cars
bikes
truck
planes
ships
buses
truck
trains
ship
ship
P A R T 3 : G R A M M A R
52
Editing LLM Features
In Hao and Linzen (2023), I show that editing an LLM’s [±plural] feature causes it to conjugate verbs incorrectly.
P A R T 3 : G R A M M A R
53
LLMs transform feature bundles into other feature representations.�(Vaswani et al., 2017)
The
cat
that
sees
the
dog
INPUT
INTERMEDIATE
OUTPUT
P A R T 3 : G R A M M A R
54
Editing one or more of these sometimes reverses verb conjugations.
The
cat
that
sees
the
dog
INPUT
INTERMEDIATE
OUTPUT
P A R T 3 : G R A M M A R
55
Editing all of these always reverses verb conjugations.
The
cat
that
sees
the
dog
INPUT
INTERMEDIATE
OUTPUT
P A R T 3 : G R A M M A R
56
Use of LLM Features
LLM representations contain semantic and syntactic features, and LLMs use these features to decide what to generate.
P A R T 3 : G R A M M A R
57
Formal Analysis
Why is the following phonological process unattested?
/abcd…/ → […dcba]
P A R T 3 : G R A M M A R
58
Circuit Complexity
Transformers can be thought of as boolean circuits, a model of parallel computation.
P A R T 3 : G R A M M A R
59
A boolean circuit�From Wikipedia
P A R T 3 : G R A M M A R
60
Complexity of Transformers
In Hao et al. (2022), I show that hard-attention Transformers (HATs) can be simulated using boolean circuits of constant depth and polynomial size.
P A R T 3 : G R A M M A R
61
In a Transformer, each layer is a “weighted average” of the previous layer.
INPUT
INTERMEDIATE
OUTPUT
P A R T 3 : G R A M M A R
62
Under hard attention, each feature bundle is based on one feature bundle from the previous layer.
INPUT
INTERMEDIATE
OUTPUT
P A R T 3 : G R A M M A R
63
Hard Attention Is Interpretable
For a machine translation model�(Bahdanau et al., 2015)
P A R T 3 : G R A M M A R
64
Provers of Hao et al.’s Theorem
Sophie Hao
BU Ling/DS, NYU DS (Fmr. Yale Ling/CS)
Bob Frank
Yale Ling
Dana Angluin
Yale CS
65
Part 3 Conclusion
LLM representations contain features that are similar to linguistic representations.
P A R T 3 : G R A M M A R
66
Analogy: �LLMs as Digital Photographs
Photo: 111-segmented LCD display on an NJ Transit train�Source: Reddit user 1Davide
P A R T 3 : G R A M M A R
67
Towards LLM Linguistics
A Research Program
P A R T 0 4
Why LLM Linguistics?
Mathematical linguists should care about LLM linguistics because…
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
69
LLM Language Phenomena
There is little understanding of what linguistic phenomena are unique to LLM language.
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
70
Languages without orthographic word boundaries may exhibit morphological garden path effects.�(Li and Hao, 2025)
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
71
Both sentences have negative sentiment, but 留心 is a positive-sentiment word.
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
72
Morphological garden pathfinders
Wing Li
SFU CS�(Fmr. NYU Eng.)
Sophie Hao
BU Ling/DS�NYU DS
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
73
Analyzing LLM Phenomena
Some LLM phenomena can be explained via linguistic analysis.
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
74
Applications of LLMs
LLMs and related technologies have broad potential for application to linguistics, social science, and the humanities.
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
75
Female Objectification
Luo et al. (2024) use LLM representations to analyze female objectification in literature.
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
76
Female objectification co-authors
Cindy Luo
Harvard Psych.�(Fmr. NYU DS)
Cora Mao
NYU DS Alum
Bella Zhang
NYU DS Alum
Sophie Hao
BU Ling/DS�NYU DS
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
77
LLMs, AI, and Society
The AI community is very interested in making sure that LLMs treat all users fairly.
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
78
You’re Invited!
LLM linguistics has something for all mathematical linguists.
P A R T 4 : T O W A R D S L L M L I N G U I S T I C S
79
Thank You!
uu@bu.edu
notaphonologist.com�
80