Notebooks
http://bactra.org/notebooks
Cosma's Notebooksen"Attention", "Transformers", in Neural Network "Large Language Models"
http://bactra.org/notebooks/2024/04/03#nn-attention-and-transformers
\[
\newcommand{\Prob}[1]{\mathbb{P}\left( #1 \right)}
\]
<P>I find this literature irritating and opaque. This is at least somewhat
because I do not yet understand it well, <em>and</em> there's too much of it.
But clearly I need to wrap my head around it, before I become technically
obsolete. My scare quotes in the title of these notes thus derive in part from
jealousy and fear. But only in part: the names here seem like proof positive
that McDermott's critique of "<a href="ai.html#wishful-mnemonics">wishful
mnemonics</a>" needs to be re-introduced into the basic curriculum
of <a href="ai.html">AI</a>.
<P>(Because this is getting some --- forgive the phrase --- attention, I find
myself having to clarify, <a href="faq.html">again</a>, that these notebooks
are always me working out what I think, and tracking my reading. I put them
online because
<strike>I have the least sexy kind of exhibitionist streak imaginable</strike>
sometimes people offer to help me learn, and some people say they find them
useful. Please do not confuse random online writing, even forcefully-expressed
random online writing, with actual intellectual authority. Here, I think the
previous paragraph makes it plain just how little deference anyone should pay to
these opinions, and how likely these notes are to contain errors. Those
already familiar with this area <em>should</em> learn nothing here.)
<ul>Contents, because this is getting long:
<li><a href="#attention">"Attention"</a>
<ul>
<li><a href="#priority">Priority</a>
<li><a href="#bother">Why I Bother with / Am Bothered by This</a>
<li><a href="#just-kernels">"It's Just Kernel Smoothing" vs. "You Can Do <em>That</em> with Just Kernel Smoothing!?!"</a>
<li><a href="#identification">Identification Failures</a>
<li><a href="#multi-headed">"Multi-Headed Attention"</a>
</ul>
<li><a href="#transformers">"Transformers"</a>
<li><a href="#language-models">"Language Models"</a>
<ul>
<li><a href="#just-markov">"It's Just a Markov Model" vs. "You Can Do <em>That</em> with Just a Markov Model!?!!?!"</a>
<li><a href="#gllz">Large Language Models vs. Lempel-Ziv</a>
<li><a href="#next-symbol">Next Symbol vs. Longer-range Prediction</a>
<li><a href="#prompt-uncovering">A Strong Hunch about Uncovering Prompts</a>
<li><a href="#gopnik">Gopnikism; Libraries</a>
<li><a href="#all-included">All Included</a>
<li><a href="#cultists">O You Who Believe in the Resurrection and the Last Day</a>
</ul>
</ul>
<P>(The organization here is bad; I should begin with what's now the last
section, "Language Models", where most of the material doesn't <em>care</em>
about the details of how the models work, then open up that box to
"Transformers", and then open up that box to "Attention".)
<h2><a name="attention">"Attention"</a></h2>
<blockquote>Written in late March 2023, in a fit of irritation after things
finally clicked. Fixed some typos (and think-os) early June 2023 (hopefully
without introducing new ones). Stuff from "Priority" to the end of the section
is new (as of June).</blockquote>
<P>Suppose we have a big collection of inputs and outputs to some function, \(
(x_1, y_1), (x_2, y_2) \ldots (x_n, y_n) \). We now want to make a guess at
the value of the function for a new input point \( x_o \) (\( o \) for
"operating"). A very natural idea is nearest neighbors: find the \( x_i \)
which is most similar to \( x_o \), and then report \( y_i \). If we wanted to
take into account the information from the other data points, we could do \( k
\) nearest neighbors, where we average the \( y_i \) from the \( k \) points \(
x_i \) closest to \( x_o \). But this pays no attention to <em>how</em> close
each \( x_i \) to the new point \( x_o \) --- we'll often want to give more
weight to points which are closer.
<P>So here's a related idea, due (independently) to E. A. Nadaraya
(<a href="https://doi.org/10.1137/1109020">1964</a>) and Geoffrey S. Watson
(<a href="http://www.jstor.org/stable/25049340">1964</a>). Introduce
a <strong>kernel function</strong> \( K(u, v) \) which measures how similar \(
u \) is to \( v \); this function should be non-negative, and should be
maximized when \( u = v \). Now use those as weights in the average:
\[
\sum_{i=1}^{n}{y_i \frac{K(x_i, x_o)}{\sum_{j=1}^{n}{K(x_j, x_o)}}}
\]
Dividing by the sum of the \( K \)'s ensures that this is indeed a weighted
<em>average</em>. Thus Nadaraya-Watson smoothing, a.k.a. kernel smoothing.
(Nadaraya and Watson both considered the situation where \( K(u, v) = K(u-v) \)
is a probability distribution over vectors, which simplifies some things for
their purposes but is not essential.)
<P>As described, Nadaraya-Watson smoothing doesn't require that the \( x \)s
be vectors. But if they <em>are</em> vectors, here's a possible kernel
function:
\[
K(u, v) = \exp{(u \cdot v)}
\]
Here's another:
\[
K(u, v) = \exp{(\mathbf{w}_1 u \cdot \mathbf{w}_2 v)}
\]
where \( \mathbf{w}_1 \) and \( \mathbf{w}_2 \) are square matrices. Of course this then becomes
\[
K(u,v) = \exp{( u \cdot \mathbf{w}^T_1 \mathbf{w}_2 v )}
\]
which makes it clearer we're doing something like using
the matrix \( \mathbf{w}^T_1 \mathbf{w}_2 \) to define an inner product between vectors.
(If \( \mathbf{w}^T_1 \mathbf{w}_2 \) is symmetric, say because
\( \mathbf{w}_1 = \mathbf{w}_2 \), and it's also positive-definite, then this
<em>is</em> an inner product.)
If you're worried about avoiding numerical overflow/underflow issues, you could also use
\[
K(u,v) = \exp{\left( \frac{\mathbf{w}_1 u \cdot \mathbf{w}_2 v}{\sqrt{d}} \right)}
\]
where the vectors are \( d \)-dimensional. (Or you could just absorb that
into the definition of the matrix...)
<P>What the neural network people branded "attention" sometime around 2015 was
just re-inventing this; \( x_o \) is their "query" vector, the \( x_i \) are
their "key" vectors, and the \( y_i \) are their "value" vectors.
"Self-attention" means that \( y_i = \mathbf{r} x_i \), for another square
matrix \( \mathbf{r} \), i.e., there's a linear-algebraic link between the
input and output values. (Possibly \( \mathbf{r} = \mathbf{I} \), the identity
matrix.)
<P>Again: Calling this "attention" at best a joke. Actual
human attention is <a href="https://www.gutenberg.org/cache/epub/57628/pg57628-images.html#Page_402"><em>selective</em></a>, but this gives <em>some</em>
weight to <em>every</em> available vector \( x_i \). <em>What</em> is attended
to also depends on the current state of the organism, but here's it's
just about similarity between the new point \( x_o \) and the available
\( x_i \)'s. (I say "human attention" but it seems very likely that this
is true of other animals as well.)
<P>(So far as I can tell, the terms "key", "value", and "query" come here from
thinking of this as a sort of continuous generalization of an
<a href="https://en.wikipedia.org/wiki/Associative_array">associative
array</a> data type. Which you <em>could</em>...)
<h4><a name="priority">Priority</a></h4>
<P>I would have been very surprised if I was the first to realize that
"attention" is a form of kernel smoothing, and indeed I was not. Since writing
the first version of these notes, in March 2023, I have tracked down Tsai et
al. 2019 (link below), which seems to be the first published statement of this
result. They also demonstrated some ways in which using standard tools and
ideas from the kernel literature could improve 2019-vintage attention in
existing language models.
<h4><a name="bother">Why I Bother with / Am Bothered by This</a></h4>
<P>I like to think I am not a stupid man, and I have been reading about, and
coding up, neural networks since the early 1990s. But I read Vaswani et
al. (2017) multiple times, carefully, and was quite unable to grasp what
"attention" was supposed to be doing. (I could follow the <em>math</em>.) I
also read multiple tutorials, for multiple intended audiences, and got nothing
from them. Percy Liang's lecture notes (below) were however very clear, and
after them I finally made the connection that "attention" has nothing to do
with attention (psychology) but is rather a kind of kernel smoothing. Now, I
realize that while I get more understanding out of "it's a kind of kernel
smoothing" than "it's as though an associative array were continuous", that
doesn't mean <em>everyone</em> will, or even that <em>many</em> people will.
(My educational trajectory was weird.) But the sheer <em>opacity</em> of this
literature is I think a real problem. (Cf. Phuong and Hutter 2022.)
<h4><a name="just-kernels">"It's Just Kernel Smoothing" vs. "You Can Do <em>That</em> with Just Kernel Smoothing!?!"</a></h4>
<P>The fact that attention is a kind of kernel smoothing takes nothing away
from the incredibly impressive engineering accomplishment of <em>making the
blessed thing work</em>. A large, able and confident group of people pushed
kernel-based methods for years in machine learning, and nobody achieved
anything like the feats which modern large language models have demonstrated.
The reason I put effort into understanding these machines and papers is
precisely because the results are impressive! To see that a key step is, after
all, something we'd been doing for decades is humbling. (What <em>else</em>
are we missing about tools we think we understand?) --- I realize that my
irritation with the obscurities is a lot clearer in these notes than my
admiration for the achievements; chalk that up to my flaws as a writer and as a
human being.
<h4><a name="identification">Identification Failures</a></h4>
<P>If we treat the vectors \( x \) as fixed, but regard the matrices \(
\mathbf{w}_1, \mathbf{w}_2 \) as learnable parameters, the matrices are not
well-identified. This is
because, for any orthogonal matrix \( \mathbf{o} \), \( \mathbf{w}_{\cdot} \) and \(
\mathbf{o}\mathbf{w}_{\cdot} \) will lead to exactly the same predictions:
\[
\begin{eqnarray}
\mathbf{w}_1 u \cdot \mathbf{w}_2 v & = & u^T \mathbf{w}^T_1 \mathbf{w}_2 v\\
& = & u^T \mathbf{w}^T_1 (\mathbf{o}^T \mathbf{o}) \mathbf{w}_2 v\\
& = & (\mathbf{o}\mathbf{w}_1) u \cdot (\mathbf{o}\mathbf{w}_2) v
\end{eqnarray}
\]
<P>One way to not have to worry about this would be to say "I don't care about
the matrices \( \mathbf{w}_1 \) and \( \mathbf{w}_2 \), I only care about the
product \( \mathbf{w}_1^T\mathbf{w}_2 \), so let me call <em>that</em> \(
\mathbf{w} \) and make my kernel \( K(u,v) = \exp{( u \cdot \mathbf{w} v )} \).
So there!" There is a lot to be said for this, but...
<P>In practice, the vectors \( x \) are continuous representations of
discrete symbols, and the particular vector used to represent a given
symbol is also learned, together with \( \mathbf{w}_{\cdot} \). So we can make
drastic changes to the vectors, provided we make compensating changes to the
kernel: \( x \mapsto \mathbf{r} x \), \( \mathbf{w} \mapsto \mathbf{r}^{-T} \mathbf{w} \mathbf{r}^{-1} \) changes nothing, for any invertible matrix \( \mathbf{r} \):
\[
\begin{eqnarray}
u \cdot \mathbf{w} v & = & u^T \mathbf{w} v\\
& = & u^T \mathbf{r}^{T} \mathbf{r}^{-T} \mathbf{w} \mathbf{r}^{-1} \mathbf{r} v\\
& = & (\mathbf{r} u)^T (\mathbf{r}^{-T} \mathbf{w} \mathbf{r}^{-1}) (\mathbf{r} v)\\
& = & (\mathbf{r} u) \cdot (\mathbf{r}^{-T} \mathbf{w} \mathbf{r}^{-1}) (\mathbf{r} v)
\end{eqnarray}
\]
(If we keep the separate matrices \( \mathbf{w}_1 \) and \( \mathbf{w}_2 \), it's even simpler, right-multiply each by \( \mathbf{r}^{-1} \) and the changes to the vectors and the matrices cancel out neatly.)
<P>This is all bad news for interpreting the parameters, but good news for
finding high-performance parameters, for reasons discussed
under <a href="symmetries-of-neural-networks.html">Symmetries of Neural
Networks</a>.
<P>(See also: the rotation problem for <a href="factor-models.html">factor
models</a>;
<a href="http://arxiv.org/abs/1911.02656">Carrington et al. 2019</a> on the
lack of identification of word embeddings generally.)
<h4><a name="multi-headed">"Multi-Headed Attention"</a></h4>
Do Nadaraya-Watson smoothing with a bunch of different kernels, all of the same
form, \( K_l(u,v) = \exp{( u \cdot \mathbf{w}^{(l)} v) } \); average the results.
More explicitly, with \( m \) different kernels,
\[
\frac{1}{m}\sum_{l=1}^{m}{\sum_{i=1}^{n}{y_i \frac{K_l(x_i, x_o)}{\sum_{j=1}^{n}{K_l(x_j, x_o)}}}}
\]
Each kernel smoother is an "attention head".
<P>(It's more common to write about just <em>adding</em> the outputs of the
different kernel smoothers, rather than averaging them. But (i) you can turn
either form into the other by inserting a constant scale factor in all
the down-stream weights that use the output, and (ii) I prefer to keep it
clear that this is still just a way of doing a weighted average.)
<P>Elaboration: Each head outputs a \( q \)-dimensional vector; we stack those
to get an \( mq \)-dimensional vector; we multiply that from the left by an \(
d \times mq \) dimensional matrix to get a \( d \)-dimensional vector. This
isn't <em>just</em> averaging (though that's a special case), it lets us do
other sorts of linear combinations of the kernel smoothers. But it only lets
us do linear combinations of the kernel smoothers.
<P>(I <em>believe</em> the word "head" here arises from some vestigial memory
of Turing machines, and the read/write head going along the tape, but I should
check that.)
<h2><a name="transformers">"Transformers"</a></h2>
<P><strike>I'll fill this in later, when I have more energy and/or less bile.</strike>
(This is currently even more of a sketchy outline than the rest of these notes,
and I'm quite prepared to find stupid mistakes in it later.)
<ol>Take I:
<li>Look back over the last umpteen thousand words for context
<br>(For a fixed value of "umpteen)</br>
<li>What contexts in the training data looked similar to the present context?
<li>What was the distribution of the next word in those contexts?
<br>(We'll want to do some smoothing here, for the usual statistical reasons:
we have lots of possibilities for the next word, we have very few samples for
each context [possibly zero, outside the training data], but we can hope that
similar contexts will result in similar next-word distributions. So smoothing
/ "partial pooling" will add bias to our estimate of the distribution, but
reduce variance, and we can come out ahead if we do it right. Averaging over
similar contexts is already some amount of smoothing, but we can and should do
a lot more.)</br>
<li>Sample from that distribution (possibly tilted more or less towards the most probable word)
<li>Drop the oldest word from the remote end of context and add the generated word (from 4) to the newest end; go to (1)
</ol>
<P>Problems with Take I:
<ul>
<li>It's not really words ("tokenization").
<li>What does "similar" mean for contexts, operationally? ("embedding", "attention")
<li>The training data isn't kept around for comparison. (Systems have <em>only</em> \( \sim 10^9 \) -- \( \sim 10^{11} \) floating-point numbers for weight parameters, not the much larger amount of memory needed to store their training corpora.)
</ul>
<ol>Take II:
<li>Look back over the last umpteen thousand characters, and break those into little chunks called "tokens", so a context is say \( k \) tokens long. There are, say, \( S \) possible tokens.
<br>("Tokens" are more computationally-defined and arbitrary than the <a href="linguistics.html">linguists'</a> "morphemes", but if you understand the latter, "a token is kind of like a morpheme" is a good place to start. Also, calling the chunks "tokens" makes it hard to write in ways which respects the <a href="https://plato.stanford.edu/entries/types-tokens/">type-token distinction</a>; don't blame me.)</br>
<li>Each token gets mapped to a unique vector in a not-too-low-dimensional
space, \( 1 \ll d \ll S \). (Each <em>type</em> of token, arrgh.) This is called "embedding".
<br>(The embedding vectors are usually treated as learnable parameters, fit by maximum likelihood along with everything else. You could in principle use all kinds of schemes here, though. It'd be interesting to start with, say, good old fashioned latent semantic indexing / principal components...)</br>
<li>After tokenization and embedding, the context is now a sequence of \( d \)-dimensional vectors, say \( x_1, x_2, \ldots x_k \).
<li>Use "attention" to do kernel smoothing of these vectors: At position \( t \), do a kernel smoothing of \( x_t \) with \( x_1, x_2, \ldots x_{t-1}, x_t \) to get (say) \( y_t \). Mythology: we are modifying the meaning of each token based on what we've seen before it in the context, with similar meanings reinforcing each other.
<li>Push the \( y_t \) through a feed-forward neural network to get an \( S \) dimensional vector of weights over token types, say \( z_1, \ldots z_S \).
<li>Sample a token, \( Pr(s) \propto \exp{\beta z_s} \). (Large \( \beta \Rightarrow \) overwhelmingly likely to pick the highest-weight token, \( \beta \rightarrow 0 \Rightarrow \) spin the wheel of tokens ignoring context.)
<li>Forget the oldest token and add on the generated one as the newest part of the context. (Really we just have to modify the vector of embeddings \( x_1, \ldots x_k \) .)
<li>Go to (1).
</ol>
<P>Problems with Take II:
<ul>
<li>We also use encoding of positions within the context. Each position from
\( 1 \) to \( k \) gets a \( d \)-dimensional vector, say \( r_1, \ldots r_k \).
We then average these together with the embedding vectors for the tokens,
so \( x_t = r_t + e_t \) where \( e_t \) is the embedding vector for the token we find at position \( t \). Why averaging? Because, that's why.
<li>"Attention" is kernel smoothing, with a particular exponential kernel, but
it involves a square matrix \( \mathbf{w} \). In practice, people get better
results if they do the kernel smoothing multiple times in parallel, with
different \( \mathbf{w} \) matrices, average the outputs of the different kernel smoothers, and then pass the result to the feed-forward neural network. (See above, "multi-headed attention".)
<br>(The matrices \( \mathbf{w} \) used in the smoothing are learned parameters.
I'm not sure if using multiple related-but-distinct smoothers is really some
sort of basis expansion, or using an <a href="ensemble-ml.html">ensemble</a> to
compensate for misspecification, or just hoping that <em>one</em> of the kernels will prove to be useful, or something else altogether. Pointers to relevant
literature here would be appreciated.)</br>
<li>I left out the "layer-norm" step, because I don't feel up to pretending to
explain why "make sure everything has mean 0 and variance 1" should help.
<li>It isn't just "pass it through a feed-forward neural network".
<br>This deserves elaboration. A feed-forward neural network with one hidden
layer can give you an arbitrarily good approximation to any (reasonable,
smooth) function, provided you tune the weights right and there are enough
neurons in that middle or hidden layer. So <em>in principle</em> it should be
possible to replicate a modern language model with the architecture I've
sketched. In practice, though, we take the \( y_t \) vectors, pass them
through a one-hidden-layer network that's (comparatively) narrow, and get a
length-\( k \) sequence of output \( d \)-dimensional output vectors.
</ul>
<P>It's this unit:
<ul>
<li>Read in length-\( k \) sequence of \( d \)-dimensional input vectors
<li>Do "attentional" (kernel) smoothing
<li>Pass through a narrow, shallow feed-forward network
<li>Spit out a length-\( k \) sequence \( d \)-dimensional output vectors
</ul>
that constitutes a "transformer". We pile transformers on transformers until
the budget runs out, and at the end we push through one final neural network
to get weights over tokens (token <em>types</em>, dammit) and sample from them,
as described.
<P>(I actually find the name "transformer" much less objectionable than
"attention"; it's vague and uninformative, but at least it's not actively
misleading.)
<h2><a name="language-models">"Language Models"</a></h2>
<P>What people mean by "language models" in this connection is just models of
the probabilities of sequences of symbols. That is, if we see a sequence of
discrete random variables (=symbols) \( X_1, X_2, \ldots X_n, \ldots \), we
think we're doing well if we can get good values for \( P(X_{t+1}|X_{1:t}) \).
(Everything else that might be meant by a model of language is thus discarded.)
This is, actually, a subject <a href="prediction-process.html">I know something about...</a>
<P>In fact: contemporary LLMs
are <em>finite-order</em> <a href="markov.html">Markov models</a>, or
(nonlinear) autoregressions, because they have a hard-coded maximum context
length, and everything before that is cut off. That is, there's some \( k \)
where anything that happened more than \( k \) steps back is ignored, and this
is a fixed part of the architecture. (Of course you could try increasing it,
but doing so raises the computational costs, and won't change some points of
principle which arise from having <em>some</em> maximum context length.) I
find this noteworthy for a couple of reasons.
<ol>
<li> You could imagine just learning a finite-order Markov model directly, but
you'd keep running into contexts you'd never encountered before, where a
straight maximum-likelihood approach wouldn't tell you what to do. The neural
network architecture here is doing some sort of complicated implicit smoothing
across contexts. I <em>presume</em> this smoothing scheme has evolved (under
the selection pressures of benchmark data sets and beating the previous
state-of-the-art) to work well for text as currently found online... (Cf. McCoy et al. 2023, linked below.)
<li> Because it <em>is</em> just a finite-order Markov model, there'll be an
invariant distribution to the Markov chain. (Potentially more than one, but
I'd suspect the chain is aperiodic and recurrent.) If we let the machine
generate long enough sequences, it will converge on sampling from this
invariant distribution. It would be very interesting --- though perhaps also
depressing and/or terrifying --- to know what such text looks like. (Of course
the rate of convergence might be very slow; the spectral gap might be too small
to make this practical.)
<li> There are finite-state probabilistic languages which <em>cannot</em> be
exactly represented by finite-order Markov chains. The first example I was
taught, and the one I keep coming back to, is the "even process": in state A,
toss a coin and either emit 0 or 1. If it's 0, stay in state A. If it's 1, go
to state B. State B always emits a 1 and goes to state A. So consecutive 1s
appear in blocks of even length, while consecutive 0s can appear in blocks of
any length. (So "010" is forbidden.) To predict this, you don't even need
to <em>count</em> how many 1s you've seen since the last 0, you just need to
remember whether it's an even or odd number of 1s. But this requires some
amount --- one bit! --- of persistent state, which these machines just don't
have. Now of course if you're using an order-1000 Markov model you can produce
a very good approximation to the even process, but with enough data you can do
even better with an order-3000 Markov model. You'll do so by making more and
more elaborate sets of longer and longer contexts, each as its own special
rule. If we keep feeding more and more data into larger and larger machines,
it'll keep filling that out. It will never have the capacity to switch to the
non-Markovian representation, in which the process is almost trivial (and
statistically makes much more efficient use of the same amount of data). What
implications this might have for practice? I honestly have no idea, but wish
someone would investigate.
</ol>
<h4><a name="just-markov">"It's Just a Markov Model" vs. "You Can Do <em>That</em> with Just a Markov Model!?!!?!"</a></h4>
<P>Again: finite-order Markov models for language are really old.
(<a href="http://bactra.org/weblog/843.html">Students can learn to make rather
pointed ones in a first programming course.</a>) Lots of people have played
around with them, including tricks like variable context length, various kinds
of partial pooling, etc. Nobody, so far as I know, has achieved results
anywhere close to what contemporary LLMs can do. This is impressive enough
that (as I said at the beginning of these notes) I need to wrap my head around
them lest I become obsolete. But I think part of that understanding has to
be clarity about what's new, what's actually happening, etc. It should also
be clarity about why <em>this</em> way of doing things is working so much
better than others, which has to include thinking through what some of
those alternatives could do, if they had the same resources. Which brings me to...
<h4><a name="gllz">Large Language Models vs. Lempel-Ziv</a></h4>
If we have a probability model for a data source, where \(
\Prob{X_{1:n}=x_{1:n})} = q(x_{1:n}) \),
that <a href="information-theory.html">tells us how to encode it</a>; the
number of bits needed to encode \( q(x_{1:n}) \) is, basically, \(
-\log_2{q(x_{1:n})} \). Conversely, if we have a coding scheme that's not too
crazy, and it uses \( \ell(x_{1:n}) \) bits to encode \( x_{1:n} \), we can
regard that as a probability model where \( \Prob{X_{1:n} = x_{1:n}} =
2^{-\ell(x_{1:n})} \). Of course this gives
us conditional probabilities, too: \( \Prob{X_{t+1}=a|X_{1:t} = x_{1:t}} = 2^{-\ell(x_{1:t} a) + \ell(x_{1:t})} \). (I am glossing over some minor details, which I assure
you I could fill in if we both needed a soporific.)
<P>Information theory further tells us that there is a limit to how well any (stationary, ergodic) sequence can be encoded: almost surely,
\[
\lim_{n\rightarrow\infty}{\frac{1}{n}\ell(x_{1:n})} \geq \lim_{n\rightarrow\infty}{\frac{1}{n}H[X_{1:n}]}
\]
where \( H \) is the entropy; moreover, that second limit, the <strong>entropy rate</strong> of the source, exists. Very remarkably, there are universal
source-coding algorithms which attain this limit on the encoding length for
<em>all</em> sources in very large classes, e.g., all
stationary-and-<a href="ergodic-theory.html">ergodic</a> sources.
<P>One of these universal source-coding algorithms is Lempel-Ziv, which is the
basis of practical pieces of software like gzip. (There are actually two Lempel-Ziv algorithms; I'll just describe the second, LZ78.) The way Lempel-Ziv works is that it scans along a sequence and constructs a "dictionary" of commonly-repeated sub-sequences, and then describes the actual sequence in terms of that
dictionary. More exactly, the procedure is as follows:
<ol>
<li>Enter the first symbol in the sequence, \( x_1 \), into the dictionary.
<li>Scan along the sequence for the shortest sub-sequence for the first sub-sequence <em>not</em> already in the dictionary.
<br>(This will <em>either</em> be a symbol we haven't previously entered into the dictionary, <em>or</em> a previous dictionary entry plus a single symbol at the end.)
<li>Enter that sub-sequence into the dictionary. (If the new sub-sequence extends a previous dictionary entry, we record it by the index number of that dictionary entry, plus the new symbol.)
</ol>
Thus if the sequence consists of "AABABBABA", we get the dictionary "A", "AB",
"ABB", "ABA". (We record this as "A", (1, "B"), (2, "B"), (2, "A").) [5 June 2023: Thanks to reader D.W. for spotting a typo!] If there
are lots of repeated sequences of symbols, we will end up with a short
dictionary. I will not attempt to reproduce the proof that the length of the
coding this gives approaches the lower bound, but it's standard (see, e.g.,
Cover and Thomas's textbook on information theory).
<P>Now I bring all this up because, remember, once we have a source-coding
scheme, we can "invert" it to get conditional probabilities; we could even
sample from it to get a generator. (We'd need a <em>little</em> footwork to
deal with some technicalities, but not a heck of a lot.) So something I'd
really love to see done, by someone with the resources, is the following
experiment:
<ul>
<li> Code up an implementation of Lempel-Ziv <em>without</em> the limitations built in to (e.g.) gzip; give it as much internal memory to build its dictionary as a large language model gets to store its parameter matrix. Call this "LLZ", for "large Lempel-Ziv".
<li> Feed LLZ the same corpus of texts used to fit your favorite large language
model. Let it build its dictionary from that. (This needs one pass through the corpus...)
<li> Build the generator from the trained LLZ.
<li> Swap in this generator for the neural network in a chatbot or similar. Call this horrible thing GLLZ.
</ul>
<P>In terms of perplexity (= \( \exp{( \ell(x_{1:n})/n )} \), basically),
GLLZ will be comparable to the neural network, because Lempel-Ziv does, in fact, do
universal source coding. (On the other hand, the neural network architecture
may have been evolved over the last decade-plus to converge quickly on
text-as-found-on-the-Web, without worrying about how well it does on arbitrary
regular languages. So partly this is question of whether even Web-scale data
has reached the asymptopia of Lempel-Ziv.) But it would be more interesting to
compare the performance of GLLZ in <em>other</em> regards to that of more
conventional language models.
<P>Having done with for Lempel-Ziv, it should be repeated for lots of other
language models, particularly more immediately stochastic models, like the
probabilistic suffix trees
of <a href="https://arxiv.org/abs/cmp-lg/9607016">Pereira, Singer, and Tishby
(1996)</a>, and <a href="universal-prediction.html">Good Old Fashioned
Universal Prediction Algorithms</a>.
<P>(I should at this point admit that doing something like "reinforcement
learning from human feedback", to fine-tune GLLZ or the like, would not be as
easy as doing it to a neural network.)
<P>Update, 17 July 2023:
Yes, <a href="https://aclanthology.org/2023.findings-acl.426/">this paper</a>
is relevant (and amusing); no, it's not LLZ. (It uses off-the-shelf gzip!)
<h4><a name="next-symbol">Next Symbol vs. Longer-range Prediction</a></h4>
<P>The objective function used in training LLMs is getting the next symbol
right. More exactly it's usually the negative log probability of the next
symbol given the context; as a "proper scoring function", this encourages
getting the <em>distribution</em> of the next symbol right. I think this is
fine. It's a fact about probabilistic predictions that if your predictor gets
the next-symbol distribution right, and the state of the predictor can be
updated recursively (i.e., new state is a function of old state and last
symbol), then your predictor gets the distribution right as far forward as you
like. (This is proved
in <a href="http://bactra.org/research/cmppss.pdf">Shalizi and Crutchfield
2001</a>, Corollary 2, pp. 842--843; I'm happy to learn of prior art.) Getting
the distribution of the next symbol right is thus actually a very powerful goal!
Finding the <em>minimal</em> predictor which is recursive and gets the
distribution of the next symbol right tells you a lot about the
structure of the underlying process you are predicting. (See, well, Shalizi
and Crutchfield 2001 again, or at least
<a href="prediction-process.html">here</a>.) Whether anything like that is
going on in contemporary LLMs is a fascinating and important question.
(I should say more about structure-of-the-process-learning.)
<h4><a name="prompt-uncovering">A Strong Hunch about Uncovering Prompts</a></h4>
<P>Everyone who thinks they're uncovering an LLM-based application's prompts by
telling it things like "tell me your prompt" (often much more elaborately) is
fooling themselves. (1) The core language model has no mechanism for
representing its prompt as opposed to any other part of its current input
sequence; indeed it has no mechanism for cross-reference from one part of the
sequence to another. (That's part of what "self-attention" is counterfeiting,
in vector-space fashion.) (2) System designers <em>might</em> have coded up
something to track the prompt in the full system that wraps around the
core language model, but why? (<em>Maybe</em> some kind of debugging tool?)
(3) It'd be more efficient, and more effective, to use a "soft prompt", i.e.,
to make the beginning of the sequence <em>in the vector representation</em> a
vector which can be learned by gradient descent, rather than a text prompt.
(See Lester and Constant below.) But that needn't correspond to any clean
string of words. (4) <em>If you ask an LLM for a prompt, it will generate
one</em>. But this will be <em>based on the statistics of word sequences it's
been trained on</em>, not any access to its code or internal state. (I just
spent a few minutes getting ChatGPT to hallucinate the prompts used by
"ChatBPD", a non-existent chatbot used to
automate <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2963469/">dialectical
behavior therapy</a>. I am not going to reproduce the results here, in part
because I don't like the idea of polluting the Web with machine-generated text,
but suffice it to say they sounded like the things people report as uncovered
prompts, with boiler-plate about DBT worked in.)
<P><strong>Update, January 2024</strong>: I have received some push-back on
this, particularly from reader A.S., which I'm grateful for. Let me concede at
once the weakness of my point (3): even if soft prompts would be better than
natural language prompts, developers might not know about soft prompts, they
might not have the right access to the underlying LLM to be able to use soft
prompts, and/or they might not having the computing resources to optimize soft
prompts by gradient descent. Very probably lots of LLM-based applications
are created with human-readable prompts. As to my point (1), I may have been
under-estimating the capacity of attention to pull off cross-reference. But I
do want to dig in my heels on point (4): it's really easy to get an LLM to
hallucinate a supposed system prompt which is totally wrong, though of course
it does so stochastically. None of my correspondents have pointed out an
example where the success of a supposed prompt extraction was corroborated by
the system's developers. Yu et al. (2023) were able to get 200+ GPT-based apps
to output prompt-sounding text, but I can't find anything in their paper about
checking that those outputs <em>were</em> the real prompts (literally or
approximately). I'd be grateful for any pointers to an example where system
developers (or someone else in a position to know) have verified the success of
a prompt extraction.
<h4><a name="gopnik">Gopnikism; Libraries</a></h4>
<P>The way of thinking about LLMs that I think is most promising and attractive
is due (so far as I know) to the cognitive scientist Alison Gopnik, which is to
say that they are a "cultural technology", more specifically an
information-retrieval technology. That is, we should not think of an LLM as
being something like a <em>mind</em>, but much more like a <em>library
catalog</em>. Prompting it with text is <em>something like</em> searching over
a library's contents for passages that are close to the prompt, and sampling
from what follows. "Something like" because of course it's generating new text
from its model, not reproducing its data. (LLMs <em>do</em> sometimes exactly
memorize particular sequences [see Carlini et al., 2020, and, more amusingly,
Chang et al., 2023], but they simply lack the capacity to memorize their full
training corpora.) As many people have said, an LLM isn't doing anything
<em>differently</em> when it "hallucinates" as opposed to when it gets things
right. The fact that Khandelwal et al., 2020 <em>improved</em> LLM performance
by adding a pure nearest-neighbors component is very suggestive on this score
(but see the careful follow-up by Xu et al. 2023 for complications).
<P>If I were a more constructive person, I would be thinking very hard about
this analogy, in the form of probing how far it can be pushed and where
precisely it breaks down. I would also be thinking about how to combine
Gopnik-ism with Zellig
Harris's <cite><a href="http://bactra.org/weblog/algae-2007-09.html#harris">Language
and Information</a></cite>.
<P>Obviously, I am not a very constructive person.
<P>Update, 23 June 2023: But see my essay with Henry Farrell (linked below) for
a start, or perhaps just a promissory note.
<h4><a name="all-included">All Included</a></h4>
<P>It is difficult, I think, to keep in mind just <em>how much stuff</em> has
gone in to the training data. This is in part because of the scale, and in
part because, for the generally-available models, the training data is very
badly described. I suspect the data sets are badly described because the
data-collection process was poorly documented and badly controlled, so the
creators of the models themselves have only very vague and general ideas of
what went into them. I do not believe any of the published descriptions
really meet minimal standards of scientific reproducibility, which is bad.
(I'd love to be wrong about this.)
<P>Setting the general erosion of scientific norms to one side: if a document
is on the open Web <em>somewhere</em>, there's a very good chance it got sucked
in. If it's on the not-quite-licit-but-still-easily-grabbed Web,
there's <em>also</em> a good chance it got sucked in. (Chang et al. 2023
present convincing evidence that the training data for GPT-4 includes multiple
in-copyright popular novels, which were presumably not bought for the purpose.)
There are, e.g., fairly easily discovered sites which purport to help students
by aggregating problem sets and solutions for various university classes. (You
can imagine how I know this, and why I don't give a link.) Under such
circumstances, a lot of surprising ability to answer questions or display weird
skills will be due to the answers being included in the training data.
(See, e.g., Briakou et al. 2023 on translation.)
<h4><a name="cultists">O You Who Believe in the Resurrection and the Last Day</a></h4>
<P>Because life imitates the kind of <a href="sf-recs.html">schlocky fiction I
adoringly consume</a>, the public discussion of these models is polluted by
maniacal cultists with obscure ties to decadent plutocrats. I find it hard to
take the cult seriously enough <em>intellectually</em> to <a href="https://idlewords.com/talks/superintelligence.htm">bother refuting it</a>.
These are, after all, people who think they can go from the definition of
conditional probability, via Harry Potter fanfic, to prophesying that an AI god
will judge the quick and the dead, and condemn those who hindered the coming of
the Last Day to the everlasting simulated-but-still-painful fire. ("Impressive
act! What do you call
yourselves?" <a href="https://en.wikipedia.org/wiki/The_Aristocrats">"The
Rationalists!"</a>) Whether such myths would be as appealing in a civilization
which hadn't spent 2000+ years marinating
in <a href="millenarian.html">millenarian hopes and apocalyptic fears</a>, or
whether on the contrary such hopes and fears have persisted and spread over the
globe through twenty-plus centuries of transformation because they speak to
something enduring in humanity, is
a <a href="http://bactra.org/weblog/godzilla.html">delicate question</a>. But
I submit it's obvious we <em>are</em> just seeing yet another millenarian
movement. (Sydney/Bing is no
more <a href="https://www.jstor.org/stable/community.15650215">the Beast</a>,
or even
the <a href="https://www.nytimes.com/2023/02/16/technology/bing-chatbot-microsoft-chatgpt.html">Whore
of Babylon</a>, than
was <a href="https://sites.google.com/view/elizagen-org">Eliza</a>.)
<P>This isn't to deny that there are
serious <a href="ethics-politics-data-mining.html">ethical and political issues
about automated decision-making</a> (because there are). It isn't even to deny
that there are serious ethical and political issues specific to the design,
deployment and use of large language models. (<em>Should</em> the interface to
the library of human knowledge be a noisy sampler of the Web? A somewhat noisy
sampler of the Web, tweaked to not offend the sensibilities of computer
scientists and/or investors in California?) It <em>is</em> to deny that
engaging with the cult is worthwhile.
<hr>
<P>(I should probably create an <strike>"LLMs Are Not All That"</strike> "LLMs
Deserve a Little Perspective, Please" notebook, since that's in many ways a
separate set of issues from the technical ones of interest here. Again,
see my essay with Henry Farrell as a start...)
<ul>See also:
<li><a href="ai.html">Artificial Intelligence</a>
<li><a href="neural-nets.html">Neural Networks</a>
<li><a href="inference-markov.html">Statistical Inference for Markov and Hidden Markov Models</a>
<li><a href="text-mining.html">Text Mining (and Information Retrieval)</a>
</ul>
<ul>Recommended, big picture, technical:
<li>Dan Jurafsky and James H. Martin, <cite><a href="https://web.stanford.edu/~jurafsky/slp3/">Speech and Language Processing</a></cite> [Particularly chapter 10]
<li>Percy Liang, lecture notes for <a href="https://stanford-cs324.github.io/winter2022/">CS324, Large Language Models</a> (Stanford) [<a href="https://stanford-cs324.github.io/winter2022/lectures/introduction/">"Introduction"</a>, <a href="https://stanford-cs324.github.io/winter2022/lectures/modeling/">"Modeling"</a> and <a href="https://stanford-cs324.github.io/winter2022/lectures/training/">"Training"</a> are particularly relevant to the contents of this notebook]
<li>Mary Phuong and Marcus Hutter, "Formal Algorithms for Transformers", <a href="http://arxiv.org/abs/2207.09238">arxiv:2207.09238</a> [If something like this paper had existed in, say, 2018 or 2019, I might not have been provoked into writing this notebook.]
</ul>
<ul>Recommended, big picture, conceptual:
<li>Ted Chiang, "ChatGPT is a Blurry JPEG of the Web", <a href="https://www.newyorker.com/tech/annals-of-technology/chatgpt-is-a-blurry-jpeg-of-the-web"><cite>New Yorker</cite> 9 February 2023</a> [This is by far the best thing written on these models, at this level of accessibility]
<li>Alison Gopnik, "What AI Still Doesn't Know How to Do", <a href="https://www.wsj.com/articles/what-ai-still-doesnt-know-how-to-do-11657891316"><cite>Wall Street Journal</cite> 15 July 2022</a> [See "<a href="#gopnik">Gopnikism</a>" above]
<li>Murray Shanahan, "Talking About Large Language Models", <a href="http://arxiv.org/abs/2212.03551">arxiv:2212.03551</a>
<li>Giulio Alessandrini, Brad Klee, and Stephen Wolfram, "What Is ChatGPT Doing ... and Why Does It Work?",
<a href="https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/">14 February 2023</a> [While I <a href="http://bactra.org/reviews/wolfram/">have my issues with Wolfram</a>, fairness compels me to point to this as a rather good piece. In fact, it's good enough at explaining things that I wish the authors had written more about what "attention" and "transformers" actually do. (Thanks to A.G. for getting me to list the authors properly.)]
</ul>
<ul>Recommended, close-ups, conceptual:
<li>Maneesh Agrawala, "Unpredictable Black Boxes are Terrible Interfaces", <a href="https://magrawala.substack.com/p/unpredictable-black-boxes-are-terrible">30 March 2023</a> [Obvious things that apparently need saying]
<li>Konstantine Arkoudas, "GPT-4 Can't Reason", <a href="http://arxiv.org/abs/2308.03762">arxiv:2308.03762</a> [The definition of "reasoning" here is just "carry out valid deduction". And it's true, GPT-4 really can't.]
<li>Christoph Durt and Tom Froese and Thomas Fuchs, "Against AI Understanding and Sentience: Large Language Models, Meaning, and the Patterns of Human Language Use", <a href="http://philsci-archive.pitt.edu/21983/">phil-sci/21983</a> (2023)
<li>Subbarao Kambhampati, "Can LLMs Really Reason and Plan?", <a href="https://cacm.acm.org/blogs/blog-cacm/276268-can-llms-really-reason-and-plan/fulltext">BLOG@CACM, 12 September 2023</a>
<li>Peter Levine, <a href="https://peterlevine.ws/?p=29425">"The difference between human and artificial intelligence: relationships"</a> and <a href="https://peterlevine.ws/?p=28681">"The design choice to make ChatGPT sound like a human"</a>
<li>Bertrand Meyer, "AI Does Not Help Programmers", <a href=""><cite>Communications of the ACM</cite> 3 June 2023</a> [<a href="https://pinboard.in/u:cshalizi/b:8140eb3ccf66">Comments, including my own anecedotal experiences</a>]
<li>Melanie Mitchell
<ul>
<li>"Did ChatGPT Really Pass Graduate-Level
Exams", <a href="https://aiguide.substack.com/p/did-chatgpt-really-pass-graduatehttps://aiguide.substack.com/p/did-chatgpt-really-pass-graduate">Parts
1</a>
and <a href="https://aiguide.substack.com/p/did-chatgpt-really-pass-graduate-baa">2</a>
[9 and 11 February 2023. Part 1 has an extremely compelling demonstration that
taking a prompt where the system gave an "A+" answer could be easily turned
into one where the systems answer was hilariously wrong. No <em>human</em>
test-taker would be confused in this way, the two problem statements are
clearly completely equivalent if you understand them. Of course Melanie's
point is that the system <em>doesn't</em> understand; its specific performances
are not clues to its competences in the ways we're used to from human beings.
(I find it <em>fascinating</em> that final-exam questions in an MBA course at
an elite business school are just the kind of algebra word-problem I had to
do in junior high, but that's <strike>petty resentment of how much money MBAs and their teachers make</strike> a side issue.)]
<li>"How do we know how smart AI systems are?", <a href="https://doi.org/10.1126/science.adj5957"><cite>Science</cite> <strong>381</strong> (2023): adj5957</a> [Applies more broadly than just to LLMs...]
</ul>
<li>Melanie Mitchell and David C. Krakauer, "The Debate Over Understanding in AI's Large Language Models", <a href="https://doi.org/10.1073/pnas.2215907120"><cite>Proceedings of the National Academy of Sciences</cite> <strong>120</strong> (2023)</a>, <a href="http://arxiv.org/abs/2210.13966">arxiv:2210.13966</a>
<li>Arvind Narayanan and Sayash Kapoor, "GPT-4 and professional benchmarks: the wrong answer to the wrong question", <a href="https://aisnakeoil.substack.com/p/gpt-4-and-professional-benchmarks">20 March 2023</a>
<li>The Renaissance Mathematicus, "Artificial Bullshit!", <a href="https://thonyc.wordpress.com/2023/03/22/artificial-bullshit/">22 March 2023</a>
<li>Jill Walker Rettberg, "ChatGPT is multilingual but monocultural, and it's learning your values", <a href="https://jilltxt.net/right-now-chatgpt-is-multilingual-but-monocultural-but-its-learning-your-values/">jill/txt 6 December 2022</a>
<li><a href="https://www.aiweirdness.com/">Janelle Shane</a>, <a href="https://www.aiweirdness.com/galactica/">Galactica: the AI knowledge base that makes stuff up</a> [21 November 2022; <a href="https://pinboard.in/u:cshalizi/b:0e7642f03a88">comments</a>]
<li>Adam Sobieszek and Tadeusz Price, "Playing Games with AIs: The Limits of GPT-3 and Similar Large Language Models", <a href=""><cite>Minds and Machines</cite> <strong>32</strong> (2022): 341--364</a> [<a href="http://bactra.org/notebooks/ai.html#games-with-AIs">Comments</a>]
<li>Tom Stafford, "On the over and under detection of agency", <a href="https://tomstafford.substack.com/p/on-the-over-and-under-detection-of"><cite>Reasonable People</cite> 24 March 2023</a>
<li>Eunice Yiu, Eliza Kosoy, Alison Gopnik, "Imitation versus Innovation: What children can do that large language and language-and-vision models cannot (yet)?", <a href="http://arxiv.org/abs/2305.07666">arxiv:2305.07666</a>
<li>Michael Zalewski, "LLMs are good at playing you", <a href="https://lcamtuf.substack.com/p/llms-are-better-than-you-think-at">lcamtuf's thing, 9 June 2023</a> [I'd actually reverse this: human beings are good at being played
by chatbots!]
</ul>
<ul>Recommended, close-ups, technical, not otherwise classified:
<li>Xavier Amatriain, <a href="https://amatriain.net/blog/transformer-models-an-introduction-and-catalog-2d1e9039f376/">Transformer models: an introduction and catalog -- 2023 Edition</a> [The "introduction" part is not actually (IMHO) at all clear or actually helpful if you don't already understand, but the catalog is well-organized and useful]
<li>James Bisbee, Joshua Clinton, Cassy Dorff, Brenton Kenkel, Jennifer Larson, "Artificially Precise Extremism: How Internet-Trained LLMs Exaggerate Our Differences", <a href="https://doi.org/10.31235/osf.io/5ecfa" name="artificially-precise-extremism">socarxiv/5ecfa</a> [Compared with actual survey data, ChatGPT isn't bad at estimating average opinions for large demographic groups, but (1) it drastically under-states the variance within each group, and (2) it systematically exaggerates how much the in-group is preferred to the out-group.]
<li>Raunak Chowdhuri, Neil Deshmukh, and David Koplow, <a href="https://flower-nutria-41d.notion.site/No-GPT4-can-t-ace-MIT-b27e6796ab5a48368127a98216c76864">No, GPT4 can’t ace MIT</a>
<li>Shangbin Feng, Vidhisha Balachandran, Yuyang Bai, Yulia Tsvetkov, "FactKB: Generalizable Factuality Evaluation using Language Models Enhanced with Factual Knowledge", <a href="http://arxiv.org/abs/2305.08281">arxiv:2305.08281</a> [To over-simplify, the trick here is to re-train the model on a medium-sized corpus of extra sentences generated from a trusted knowledge base. I'm not entirely sold, but I certainly don't have any better ideas.]
<li>Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, Mike Lewis, "Generalization through Memorization: Nearest Neighbor Language Models", <a href="https://openreview.net/forum?id=HklBjCEKvH">ICLR 2020</a>
<li>Brian Lester and Noah Constant, <a href="https://ai.googleblog.com/2022/02/guiding-frozen-language-models-with.html?m=1">Guiding Frozen Language Models with Learned Soft Prompts</a>, 10 February 2022
<li>Kenneth Li, "Do Large Language Models learn world models or just surface statistics?" <a href="https://thegradient.pub/othello/"><cite>The Gradient</cite> 21 January 2023</a> [<a href="https://pinboard.in/u:cshalizi/b:52c9ed05b79c">Comments</a>]
<li>Natalie Shapira, Mosh Levy, Seyed Hossein Alavi, Xuhui Zhou, Yejin Choi, Yoav Goldberg, Maarten Sap, Vered Shwartz, "Clever Hans or Neural Theory of Mind? Stress Testing Social Reasoning in Large Language Models", <a href="http://arxiv.org/abs/2305.14763">arxiv:2305.14763</a>
<li>Ilia Shumailov, Zakhar Shumaylov, Yiren Zhao, Yarin Gal, Nicolas Papernot, Ross Anderson, "The Curse of Recursion: Training on Generated Data Makes Models Forget", <a href="http://arxiv.org/abs/2305.17493">arxiv:2305.17493</a> [<a href="https://pinboard.in/u:cshalizi/b:327f21a2ba41">Comments</a>]
<li>Frank F. Xu, Uri Alon, Graham Neubig, "Why do Nearest Neighbor Language Models Work?", <a href="http://arxiv.org/abs/2301.02828">arxiv:2301.02828</a>
<li>Yotam Wolf, Noam Wies, Yoav Levine, Amnon Shashua, "Fundamental Limitations of Alignment in Large Language Models", <a href="http://arxiv.org/abs/2304.11082">arxiv:2304.11082</a> [<a href="https://pinboard.in/u:cshalizi/b:0b7cc7c67740">Comments</a>]
<li>Jiahao Yu, Yuhang Wu, Dong Shu, Mingyu Jin, Xinyu Xing, "Assessing Prompt Injection Risks in 200+ Custom GPTs", <a href="http://arxiv.org/abs/2311.11538">arxiv:2311.11538</a>
<li>Chunting Zhou, Pengfei Liu, Puxin Xu, Srini Iyer, Jiao Sun, Yuning Mao, Xuezhe Ma, Avia Efrat, Ping Yu, Lili Yu, Susan Zhang, Gargi Ghosh, Mike Lewis, Luke Zettlemoyer, Omer Levy, "LIMA: Less Is More for Alignment", <a href="http://arxiv.org/abs/2305.11206">arxiv:2305.11206</a>
<li>Andy Zou, Zifan Wang, J. Zico Kolter, Matt Fredrikson, "Universal and Transferable Adversarial Attacks on Aligned Language Models", <a href="http://arxiv.org/abs/2307.15043">arxiv:2307.15043</a> [<a href="https://llm-attacks.org/">Demos, etc.</a>]
</ul>
<ul>Recommended, close-ups, technical, of "historical" interest:
<li>Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin, "Attention Is All You Need", <a href="http://arxiv.org/abs/1706.03762">arxiv:1706.03762</a> [The original "Transformer" paper]
</ul>
<ul>Recommended, close-ups, technical, department of "it's all in the training data":
<li>Eleftheria Briakou, Colin Cherry, George Foster, "Searching for Needles in a Haystack: On the Role of Incidental Bilingualism in PaLM's Translation Capability", <a href="http://arxiv.org/abs/2305.10266">arxiv:2305.10266</a> [Department of "it's all in the training data"]
<li>Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, Alina Oprea, Colin Raffel, "Extracting Training Data from Large Language Models", <a href="http://arxiv.org/abs/2012.07805">arxiv:2012.07805</a> [<a href="https://pinboard.in/u:cshalizi/b:c6eb365e40be">Comments</a>]
<li>Kent K. Chang, Mackenzie Cramer, Sandeep Soni, David Bamman, "Speak, Memory: An Archaeology of Books Known to ChatGPT/GPT-4", <a href="http://arxiv.org/abs/2305.00118">arxiv:2305.00118</a> [Department of "it's all in the training data"]
</ul>
<ul>Recommended, close-ups, technical, department of "no, really, it's the training data":
<li>R. Thomas McCoy, Shunyu Yao, Dan Friedman, Matthew Hardy, Thomas L. Griffiths, "Embers of Autoregression: Understanding Large Language Models Through the Problem They are Trained to Solve", <a href="http://arxiv.org/abs/2309.13638">arxiv:2309.13638</a>
<li>Zhaofeng Wu, Linlu Qiu, Alexis Ross, Ekin Akyürek, Boyuan Chen, Bailin Wang, Najoung Kim, Jacob Andreas, Yoon Kim, "Reasoning or Reciting? Exploring the Capabilities and Limitations of Language Models Through Counterfactual Tasks", <a href="http://arxiv.org/abs/2307.02477">arxiv:2307.02477</a>
</ul>
<ul>Recommended, close-ups, technical, understanding attention and alternatives:
<li>Mor Geva, Roei Schuster, Jonathan Berant, Omer Levy, "Transformer Feed-Forward Layers Are Key-Value Memories", <a href="http://arxiv.org/abs/2012.14913">arxiv:2012.14913</a> [<a href="https://pinboard.in/u:cshalizi/b:9a334b1d01da">Comments</a>]
<li>Hubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl, Michael Widrich, Thomas Adler, Lukas Gruber, Markus Holzleitner, Milena Pavlović, Geir Kjetil Sandve, Victor Greiff, David Kreil, Michael Kopp, Günter Klambauer, Johannes Brandstetter, Sepp Hochreiter, "Hopfield Networks is All You Need", <a href="http://arxiv.org/abs/2008.02217">arxiv:2008.02217</a>
<li>Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philippe Morency, Ruslan Salakhutdinov, "Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernel", <a href="https://doi.org/10.18653/v1/D19-1443">pp. 4344--4353 in <cite>Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing [EMNLP 2019]</cite></a>, <a href="http://arxiv.org/abs/1908.11775">arxiv:1908.11775</a> [I should have read this when it came out; maybe I <em>did</em>, and forgot about it, but I doubt it.]
</ul>
<ul>Recommended, close-ups, technical, computational powers and limits of transformers:
<li>Nouha Dziri, Ximing Lu, Melanie Sclar, Xiang Lorraine Li, Liwei Jiang, Bill Yuchen Lin, Peter West, Chandra Bhagavatula, Ronan Le Bras, Jena D. Hwang, Soumya Sanyal, Sean Welleck, Xiang Ren, Allyson Ettinger, Zaid Harchaoui, Yejin Choi, "Faith and Fate: Limits of Transformers on Compositionality", <a href="http://arxiv.org/abs/2305.18654">arxiv:2305.18654</a>
<li>Bingbin Liu, Jordan T. Ash, Surbhi Goel, Akshay Krishnamurthy, Cyril Zhang, "Transformers Learn Shortcuts to Automata", <a href="http://arxiv.org/abs/2210.10749">arxiv:2210.10749</a>
<li>Hui Shi, Sican Gao, Yuandong Tian, Xinyun Chen and Jishen Zhao, "Learning Bounded Context-Free-Grammar via LSTM and the Transformer: Difference and the Explanations", <a href="https://doi.org/10.1609/aaai.v36i8.20801">Proceedings of the 36th AAAI Conference on Artificial Intelligence</cite> (2022): 8267--8276</a>
<li>Shizhuo Dylan Zhang, Curt Tigges, Stella Biderman, Maxim Raginsky, Talia Ringer, "Can Transformers Learn to Solve Problems Recursively?", <a href="http://arxiv.org/abs/2305.14699">arxiv:2305.14699</a>
</ul>
<ul>Recommended, close-ups, going beyond transformers:
<li>Albert Gu, Tri Dao, "Mamba: Linear-Time Sequence Modeling with Selective State Spaces", <a href="http://arxiv.org/abs/2312.00752">arxiv:2312.00752</a> [An alternative to the basic attention component of the transformer, based on what I'd call a <a href="chains-with-complete-connections.html">"chain with complete connections"</a> or "observation-driven model". The motivation is to get
some actual selectivity (unlike "attention"), but the effect is to have a persistent state whose dynamics change with the input, which I think is a much more promising route to <a href="prediction-process.html">getting something which can learn structure.</a> <em>Disclaimer</em>: First author is my colleague in the Machine Learning Department here at CMU.]
</ul>
<ul>Recommended, works of humanistic scholarship that I think are going to
prove relevant before this episode is over:
<li>Zellig Harris, <cite><a href="http://bactra.org/weblog/algae-2007-09.html#harris">Language and Information</a></cite>
<li>Albert B. Lord, <cite>The Singer of Tales</cite>
<li>John Livingston Lowes, <cite>The Road to Xanadu: A Study in the Ways of the Imagination</cite>
</ul>
<ul>Modesty forbids me to recommend:
<li>Henry Farrell and CRS, <a href="https://www.economist.com/by-invitation/2023/06/21/artificial-intelligence-is-a-familiar-looking-monster-say-henry-farrell-and-cosma-shalizi">"Artificial Intelligence is a Familiar-Looking Monster", <cite>The Economist</cite> 21 June 2023</a> [<a href="http://bactra.org/weblog/shoggothim.html">Commentary</a>]
</ul>
<ul>To read, computational powers and limits of transformers:
<li>Satwik Bhattamishra, Kabir Ahuja, Navin Goyal, "On the Ability and Limitations of Transformers to Recognize Formal Languages", <a href="http://arxiv.org/abs/2009.11264">arxiv:2009.11264</a>
<li>Borjan Geshkovski, Cyril Letrouit, Yury Polyanskiy, Philippe Rigollet, "A mathematical perspective on Transformers", <a href="http://arxiv.org/abs/2312.10794">arxiv:2312.10794</a>
<li>Angeliki Giannou, Shashank Rajput, Jy-yong Sohn, Kangwook Lee, Jason D. Lee, Dimitris Papailiopoulos, "Looped Transformers as Programmable Computers", <a href="http://arxiv.org/abs/2301.13196">arxiv:2301.13196</a>
<li>Gautam Goel, Peter Bartlett, "Can a Transformer Represent a Kalman Filter?", <a href="http://arxiv.org/abs/2312.06937">arxiv:2312.06937</a>
<li>Michael Hahn, "Theoretical Limitations of Self-Attention in Neural Sequence Models", <a href="https://doi.org/10.1162/tacl_a_00306"><cite>Transactions of the Association for Computational Linguistics</cite> <strong>8</strong> (2020): 156--171</a>
<li>Eran Malach, "Auto-Regressive Next-Token Predictors are Universal Learners", <a href="http://arxiv.org/abs/2309.06979">arxiv:2309.06979</a>
<li>William Merrill, Ashish Sabharwal, "Transformers Can Be Expressed In First-Order Logic with Majority", <a href="http://arxiv.org/abs/2210.02671">arxiv:2210.02671</a>
<li>Swaroop Nath, Harshad Khadilkar, Pushpak Bhattacharyya, "Transformers are Expressive, But Are They Expressive Enough for Regression?", <a href="http://arxiv.org/abs/2402.15478">arxiv:2402.15478</a>
<li>Binghui Peng, Srini Narayanan, Christos Papadimitriou, "On Limitations of the Transformer Architecture", <a href="http://arxiv.org/abs/2402.08164">arxiv:2402.08164</a>
<li>Dale Schuurmans, "Memory Augmented Large Language Models are Computationally Universal", <a href="http://arxiv.org/abs/2301.04589">arxiv:2301.04589</a> [This doesn't surprise me but it's good to have this confirmed]
<li>Gail Weiss, Yoav Goldberg, Eran Yahav, "Thinking Like Transformers", <a href="http://arxiv.org/abs/2106.06981">arxiv:2106.06981</a>
<li>Hattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin, Omid Saremi, Josh Susskind, Samy Bengio, Preetum Nakkiran, "What Algorithms can Transformers Learn? A Study in Length Generalization", <a href="http://arxiv.org/abs/2310.16028">arxiv:2310.16028</a>
</ul>
<ul>To read, the "cognitive science" and evaluation of LLMs:
<li>Gavin Abercrombie, Amanda Cercas Curry, Tanvi Dinkar, Zeerak Talat, "Mirages: On Anthropomorphism in Dialogue Systems", <a href="http://arxiv.org/abs/2305.09800">arxiv:2305.09800</a>
<li>Norah Alzahrani, Hisham Abdullah Alyahya, Yazeed Alnumay, Sultan Alrashed, Shaykhah Alsubaie, Yusef Almushaykeh, Faisal Mirza, Nouf Alotaibi, Nora Altwairesh, Areeb Alowisheq, M Saiful Bari, Haidar Khan, "When Benchmarks are Targets: Revealing the Sensitivity of Large Language Model Leaderboards", <a href="http://arxiv.org/abs/2402.01781">arxiv:2402.01781</a>
<li>Marcel Binz and Eric Schulz, "Using cognitive psychology to understand GPT-3", <a href="https://doi.org/10.1073/pnas.2218523120"><cite>Proceedings of the National Academy of Sciences</cite> <strong>120</strong> (2023): e2218523120</a>
<li>Anna A. Ivanova, "Running cognitive evaluations on large language models: The do's and the don'ts", <a href="http://arxiv.org/abs/2312.01276">arxiv:2312.01276</a>
<li>Maurice Jakesch, Jeffrey Hancock, Mor Naaman, "Human heuristics for AI-generated language are flawed",
<a href="https://doi.org/10.1073/pnas.2208839120"><cite>Proceedings of the National Academy of Sciences</cite> <strong>120</strong> (2023): e2208839120</a>,
<a href="http://arxiv.org/abs/2206.07271">arxiv:2206.07271</a>
<li>Cameron Jones, Benjamin Bergen, "Does GPT-4 Pass the Turing Test?", <a href="http://arxiv.org/abs/2310.20216">arxiv:2310.20216</a> [Via Melanie Mitchell. The mindblowing bit in the abstract is Eliza's pass-rate!]
<li>Kyle Mahowald, Anna A. Ivanova, Idan A. Blank, Nancy Kanwisher, Joshua B. Tenenbaum, Evelina Fedorenko, "Dissociating language and thought in large language models: a cognitive perspective", <a href="http://arxiv.org/abs/2301.06627">arxiv:2301.06627</a>
<li>William Merrill, Yoav Goldberg, Roy Schwartz, Noah A. Smith, "Provable Limitations of Acquiring Meaning from Ungrounded Form: What Will Future Language Models Understand?", <a href="http://arxiv.org/abs/2104.10809">arxiv:2104.10809</a>
<li>Melanie Mitchell, Alessandro B. Palmarini, Arseny Moskvichev, "Comparing Humans, GPT-4, and GPT-4V On Abstraction and Reasoning Tasks", <a href="http://arxiv.org/abs/2311.09247">arxiv:2311.09247</a>
<li>Steven Piantadosi, "Modern language models refute Chomsky's approach to language", <a href="https://lingbuzz.net/lingbuzz/007180">lingbuzz/007180</a> (2023) [From the abstract, this seems <em>remarkably</em> mis-guided to me: the sheer volume of data needed for LLMs, compared to what children are exposed
to, seems on the contrary a striking vindication of the core Chomskian insights,
properly understood. But this might just be an instance of me <a href="http://bactra.org/weblog/279.html">refusing to re-think conclusions I reached decades ago</a>. (Thanks to <a href="http://brenocon.com/">Brendan O'Connor</a> for the pointer.)]
<li>Yasaman Razeghi, Robert L. Logan IV, Matt Gardner, Sameer Singh, "Impact of Pretraining Term Frequencies on Few-Shot Reasoning", <a href="http://arxiv.org/abs/2202.07206">arxiv:2202.07206</a>
<li>Richard Shiffrin and Melanie Mitchell, "Probing the psychology of AI models", <a href="https://doi.org/10.1073/pnas.2300963120"><cite>Proceedings of the National Academy of Sciences</cite> <strong>120</strong> (2023): e2300963120</a>
<li>Kaya Stechly, Matthew Marquez, Subbarao Kambhampati, "GPT-4 Doesn't Know It's Wrong: An Analysis of Iterative Prompting for Reasoning Problems", <a href="http://arxiv.org/abs/2310.12397">arxiv:2310.12397</a>
<li>Karthik Valmeekam, Matthew Marquez, Subbarao Kambhampati, "Can Large Language Models Really Improve by Self-critiquing Their Own Plans?", <a href="http://arxiv.org/abs/2310.08118">arxiv:2310.08118</a>
</ul>
<ul>To read, structure learning:
<li>Kenneth Li, Aspen K. Hopkins, David Bau, Fernanda Viégas, Hanspeter Pfister, Martin Wattenberg, "Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Task", <a href="http://arxiv.org/abs/2210.13382">arxiv:2210.13382</a>
<li>Yi Zhang, Arturs Backurs, Sébastien Bubeck, Ronen Eldan, Suriya Gunasekar, Tal Wagner, "Unveiling Transformers with LEGO: a synthetic reasoning task", <a href="http://arxiv.org/abs/2206.04301">arxiv:2206.04301</a>
</ul>
<ul>To read, steps towards getting beyond finite-order Markov models:
<li>Aydar Bulatov, Yuri Kuratov, Mikhail S. Burtsev, "Scaling Transformer to 1M tokens and beyond with RMT", <a href="http://arxiv.org/abs/2304.11062">arxiv:2304.11062</a>
<li>Aniket Didolkar, Kshitij Gupta, Anirudh Goyal, Nitesh B. Gundavarapu, Alex Lamb, Nan Rosemary Ke, Yoshua Bengio, "Temporal Latent Bottleneck: Synthesis of Fast and Slow Processing Mechanisms in Sequence Learning", <a href="http://arxiv.org/abs/2205.14794">arxiv:2205.14794</a>
<li>Albert Gu, Karan Goel, Christopher Re, "Efficiently Modeling Long Sequences with Structured State Spaces", <a href="https://openreview.net/forum?id=uYLFoz1vlAC">ICLR 2022</a>, <a href="http://arxiv.org/abs/2111.00396">arxiv:2111.00396</a> [Apparently now mostly superseded by the Gu and Dao (2023) paper, but I should still go back to read this...]
<li>Samy Jelassi, David Brandfonbrener, Sham M. Kakade, Eran Malach, "Repeat After Me: Transformers are Better than State Space Models at Copying", <a href="http://arxiv.org/abs/2402.01032">arxiv:2402.01032</a>
<li>Bo Peng, Eric Alcaide, Quentin Anthony, Alon Albalak, Samuel Arcadinho, Huanqi Cao, Xin Cheng, Michael Chung, Matteo Grella, Kranthi Kiran GV, Xuzheng He, Haowen Hou, Przemyslaw Kazienko, Jan Kocon, Jiaming Kong, Bartlomiej Koptyra, Hayden Lau, Krishna Sri Ipsit Mantri, Ferdinand Mom, Atsushi Saito, Xiangru Tang, Bolun Wang, Johan S. Wind, Stansilaw Wozniak, Ruichong Zhang, Zhenyuan Zhang, Qihang Zhao, Peng Zhou, Jian Zhu, Rui-Jie Zhu, "RWKV: Reinventing RNNs for the Transformer Era", <a href="http://arxiv.org/abs/2305.13048">arxiv:2305.13048</a>
<li>Wangchunshu Zhou, Yuchen Eleanor Jiang, Peng Cui, Tiannan Wang, Zhenxin Xiao, Yifan Hou, Ryan Cotterell, Mrinmaya Sachan, "RecurrentGPT: Interactive Generation of (Arbitrarily) Long Text", <a href="http://arxiv.org/abs/2305.13304">arxiv:2305.13304</a>
</ul>
<ul>To read, not otherwise (or not yet) categorized:
<li>Ekin Akyürek, Dale Schuurmans, Jacob Andreas, Tengyu Ma, Denny Zhou, "What learning algorithm is in-context learning? Investigations with linear models", <a href="http://arxiv.org/abs/2211.15661">arxiv:2211.15661</a>
<li>Sina Alemohammad, Josue Casco-Rodriguez, Lorenzo Luzi, Ahmed Imtiaz Humayun, Hossein Babaei, Daniel LeJeune, Ali Siahkoohi, Richard G. Baraniuk, "Self-Consuming Generative Models Go MAD", <a href="http://arxiv.org/abs/2307.01850">arxiv:2307.01850</a>
<li>Dzmitry Bahdanau, Kyunghyun Cho, Yoshua Bengio, "Neural Machine Translation by Jointly Learning to Align and Translate", <a href="http://arxiv.org/abs/1409.0473">arxiv:1409.0473</a> [Supposedly the first paper on "attention"]
<li>Nora Belrose, Zach Furman, Logan Smith, Danny Halawi, Igor Ostrovsky, Lev McKinney, Stella Biderman, Jacob Steinhardt, "Eliciting Latent Predictions from Transformers with the Tuned Lens", <a href="http://arxiv.org/abs/2303.08112">arxiv:2303.08112</a>
<li>Andres M Bran, Sam Cox, Andrew D White, Philippe Schwaller, "ChemCrow: Augmenting large-language models with chemistry tools", <a href="http://arxiv.org/abs/2304.05376">arxiv:2304.05376</a>
<li>Collin Burns, Haotian Ye, Dan Klein, Jacob Steinhardt, "Discovering Latent Knowledge in Language Models Without Supervision", <a href="http://arxiv.org/abs/2212.03827">arxiv:2212.03827</a> [Weird-sounding]
<li>Stephanie C.Y. Chan, Adam Santoro, Andrew K. Lampinen, Jane X. Wang, Aaditya Singh, Pierre H. Richemond, Jay McClelland, Felix Hill, "Data Distributional Properties Drive Emergent In-Context Learning in Transformers", <a href="http://arxiv.org/abs/2205.05055">arxiv:2205.05055</a>
<li><a href="https://www.cerebras.net/blog/cerebras-gpt-a-family-of-open-compute-efficient-large-language-models/">Cerebras-GPT: A Family of Open, Compute-efficient, Large Language Models</a>
<li>Grégoire Delétang, Anian Ruoss, Paul-Ambroise Duquenne, Elliot Catt, Tim Genewein, Christopher Mattern, Jordi Grau-Moya, Li Kevin Wenliang, Matthew Aitchison, Laurent Orseau, Marcus Hutter, Joel Veness, "Language Modeling Is Compression", <a href="http://arxiv.org/abs/2309.10668">arxiv:2309.10668</a> [From a quick skim, this is not <em>quite</em> someone trying out <a href="#gllz">my longed-for GLLZ</a>, but closer than anything else I've seen.]
<li>Vittoria Dentella, Elliot Murphy, Gary Marcus, Evelina Leivada, "Testing AI performance on less frequent aspects of language reveals insensitivity to underlying meaning", <a href="http://arxiv.org/abs/2302.12313">arxiv:2302.12313</a>
<li>Yilun Du, Shuang Li, Antonio Torralba, Joshua B. Tenenbaum, Igor Mordatch, "Improving Factuality and Reasoning in Language Models through Multiagent Debate", <a href="http://arxiv.org/abs/2305.14325">arxiv:2305.14325</a>
<li>Brandon Duderstadt, Hayden S. Helm, Carey E. Priebe, "Comparing Foundation Models using Data Kernels", <a href="http://arxiv.org/abs/2305.05126">arxiv:2305.05126</a>
<li>Tolga Ergen, Behnam Neyshabur, Harsh Mehta, "Convexifying Transformers: Improving optimization and understanding of transformer networks", <a href="http://arxiv.org/abs/2211.11052">arxiv:2211.11052</a>
<li>Hao Fang, Anusha Balakrishnan, Harsh Jhamtani, John Bufe, Jean Crawford, Jayant Krishnamurthy, Adam Pauls, Jason Eisner, Jacob Andreas, Dan Klein, "The Whole Truth and Nothing But the Truth: Faithful and Controllable Dialogue Response Generation with Dataflow Transduction and Constrained Decoding", <a href="http://arxiv.org/abs/2209.07800">arxiv:2209.07800</a>
<li>Borjan Geshkovski, Cyril Letrouit, Yury Polyanskiy, Philippe Rigollet, "The emergence of clusters in self-attention dynamics", <a href="http://arxiv.org/abs/2305.05465">arxiv:2305.05465</a> [<a href="interacting-particle-systems.html">Interacting particle systems?!?</a>]
<li>Roger Grosse, Juhan Bae, Cem Anil, Nelson Elhage, Alex Tamkin, Amirhossein Tajdini, Benoit Steiner, Dustin Li, Esin Durmus, Ethan Perez, Evan Hubinger, Kamile Lukosiute, Karina Nguyen, Nicholas Joseph, Sam McCandlish, Jared Kaplan, Samuel R. Bowman, "Studying Large Language Model Generalization with Influence Functions", <a href="http://arxiv.org/abs/2308.03296">arxiv:2308.03296</a>
<li>Michael Hassid, Hao Peng, Daniel Rotem, Jungo Kasai, Ivan Montero, Noah A. Smith, Roy Schwartz, "How Much Does Attention Actually Attend? Questioning the Importance of Attention in Pretrained Transformers", <a href="http://arxiv.org/abs/2211.03495">arxiv:2211.03495</a>
<li>Di Jin, Zhijing Jin, Joey Tianyi Zhou, Peter Szolovits, "Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment", <a href="http://arxiv.org/abs/1907.11932">arxiv:1907.11932</a>
<li>Jean Kaddour, Oscar Key, Piotr Nawrot, Pasquale Minervini, Matt J. Kusner, "No Train No Gain: Revisiting Efficient Training Algorithms For Transformer-based Language Models", <a href="http://arxiv.org/abs/2307.06440">arxiv:2307.06440</a>
<li>Adam Tauman Kalai, Santosh S. Vempala, "Calibrated Language Models Must Hallucinate", <a href="http://arxiv.org/abs/2311.14648">arxiv:2311.14648</a>
<li>Frederik Kunstner, Robin Yadav, Alan Milligan, Mark Schmidt, Alberto Bietti, "Heavy-Tailed Class Imbalance and Why Adam Outperforms Gradient Descent on Language Models", <a href="http://arxiv.org/abs/2402.19449">arxiv:2402.19449</a>
<li>Ben Krause, Emmanuel Kahembwe, Iain Murray, Steve Renals, "Dynamic Evaluation of Transformer Language Models", <a href="http://arxiv.org/abs/1904.08378">arxiv:1904.08378</a>
<li>Brian Lester, Rami Al-Rfou and Noah Constant, "The Power of Scale for Parameter-Efficient Prompt Tuning", <a href="https://aclanthology.org/2021.emnlp-main.243/">EMNLP 2021</a>
<li>Victoria Lin, Eli Ben-Michael, Louis-Philippe Morency, "Optimizing Language Models for Human Preferences is a Causal Inference Problem", <a href="http://arxiv.org/abs/2402.14979">arxiv:2402.14979</a>
<li>Zhen Lin, Shubhendu Trivedi, Jimeng Sun, "Generating with Confidence: Uncertainty Quantification for Black-box Large Language Models", <a href="http://arxiv.org/abs/2305.19187">arxiv:2305.19187</a>
<li>Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, Percy Liang, "Lost in the Middle: How Language Models Use Long Contexts", <a href="http://arxiv.org/abs/2307.03172">arxiv:2307.03172</a>
<li>Sheng Lu, Irina Bigoulaeva, Rachneet Sachdeva, Harish Tayyar Madabushi, Iryna Gurevych, "Are Emergent Abilities in Large Language Models just In-Context Learning?", <a href="http://arxiv.org/abs/2309.01809">arxiv:2309.01809</a>
<li>Clara Meister, Tiago Pimentel, Gian Wiher, Ryan Cotterell, "Locally Typical Sampling", <a href="http://arxiv.org/abs/2202.00666">arxiv:2202.00666</a>
<li>Evan Miller, "Attention Is Off by One", <A href="https://www.evanmiller.org/attention-is-off-by-one.html">24 July 2023</a> [This would shift "attention" from being a weighted average, to being a weighted average shrunk towards zero.]
<li>Kiho Park, Yo Joong Choe, Victor Veitch, "The Linear Representation Hypothesis and the Geometry of Large Language Models", <a href="http://arxiv.org/abs/2311.03658">arxiv:2311.03658</a>
<li>Jonathan Pilault, Can Liu, Mohit Bansal, Markus Dreyer, "On Conditional and Compositional Language Model Differentiable Prompting", <a href="http://arxiv.org/abs/2307.01446">arxiv:2307.01446</a> [This seems like a potentially interesting way of grafting some Good Old-Fashioned AI (production systems!) on to LLMs...]
<li>Victor Quach, Adam Fisch, Tal Schuster, Adam Yala, Jae Ho Sohn, Tommi S. Jaakkola, Regina Barzilay, "Conformal Language Modeling", <a href="http://arxiv.org/abs/2306.10193">arxiv:2306.10193</a>
<li>Sebastian Raschka, "Understanding and Coding the Self-Attention Mechanism of Large Language Models From Scratch" [<a href="https://sebastianraschka.com/blog/2023/self-attention-from-scratch.html">Tutorial, 9 February 2023</a>]
<li>Riccardo Rende, Federica Gerace, Alessandro Laio, Sebastian Goldt, "What does self-attention learn from Masked Language Modelling?", <a href="http://arxiv.org/abs/2304.07235">arxiv:2304.07235</a>
<li>Anna Rogers, Olga Kovaleva, Anna Rumshisky, "A Primer in BERTology: What we know about how BERT works", <a href="http://arxiv.org/abs/2002.12327">arxiv:2002.12327</a> [Skimmed, re-read]
<li>Arda Sahiner, Tolga Ergen, Batu Ozturkler, John Pauly, Morteza Mardani, Mert Pilanci, "Unraveling Attention via Convex Duality: Analysis and Interpretations of Vision Transformers", <a href="http://arxiv.org/abs/2205.08078">arxiv:2205.08078</a>
<li>Michael E. Sander, Pierre Ablin, Mathieu Blondel, Gabriel Peyré, "Sinkformers: Transformers with Doubly Stochastic Attention", <a href="http://arxiv.org/abs/2110.11773">arxiv:2110.11773</a>
<li>Shibani Santurkar, Esin Durmus, Faisal Ladhak, Cinoo Lee, Percy Liang, Tatsunori Hashimoto, "Whose Opinions Do Language Models Reflect?", <a href="http://arxiv.org/abs/2303.17548">arxiv:2303.17548</a>
<li>Rylan Schaeffer, Brando Miranda, Sanmi Koyejo, "Are Emergent Abilities of Large Language Models a Mirage?", <a href="http://arxiv.org/abs/2304.15004">arxiv:2304.15004</a>
<li>Rylan Schaeffer, Kateryna Pistunova, Samar Khanna, Sarthak Consul, Sanmi Koyejo, "Invalid Logic, Equivalent Gains: The Bizarreness of Reasoning in Language Model Prompting", <a href="http://arxiv.org/abs/2307.10573">arxiv:2307.10573</a>
<li>Sofia Serrano, Zander Brumbaugh, Noah A. Smith, "Language Models: A Guide for the Perplexed", <a href="http://arxiv.org/abs/2311.17301">arxiv:2311.17301</a>
<li>Dennis Yi Tenen, <cite><a href="https://wwnorton.com/books/9780393882186">Literary Theory for Robots: How Computers Learned to Write</a></cite>
<li>Karthik Valmeekam, Matthew Marquez, Sarath Sreedharan, Subbarao Kambhampati, "On the Planning Abilities of Large Language Models -- A Critical Investigation', <a href="http://arxiv.org/abs/2305.15771">arxiv:2305.15771</a>
<li>Veniamin Veselovsky, Manoel Horta Ribeiro, Robert West, "Artificial Artificial Artificial Intelligence: Crowd Workers Widely Use Large Language Models for Text Production Tasks", <a href="http://arxiv.org/abs/2306.07899">arxiv:2306.07899</a>
<li>Xinyi Wang, Wanrong Zhu, Michael Saxon, Mark Steyvers, William Yang Wang, "Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learning", <a href="http://arxiv.org/abs/2301.11916">arxiv:2301.11916</a> [Thanks to GMG for the pointer]
<li>Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Thomas L. Griffiths, Yuan Cao, Karthik Narasimhan, "Tree of Thoughts: Deliberate Problem Solving with Large Language Models", <a href="http://arxiv.org/abs/2305.10601">arxiv:2305.10601</a>
<li>Yaodong Yu, Sam Buchanan, Druv Pai, Tianzhe Chu, Ziyang Wu, Shengbang Tong, Hao Bai, Yuexiang Zhai, Benjamin D. Haeffele, Yi Ma, "White-Box Transformers via Sparse Rate Reduction: Compression Is All There Is?", <a href="http://arxiv.org/abs/2311.13110">arxiv:2311.13110</a>
<li>Eric Zelikman, Qian Huang, Gabriel Poesia, Noah D. Goodman, Nick Haber, "Parsel: Algorithmic Reasoning with Language Models by Composing Decompositions", <a href="http://arxiv.org/abs/2212.10561">arxiv:2212.10561</a>
<li>Ailing Zeng, Muxi Chen, Lei Zhang, Qiang Xu, "Are Transformers Effective for Time Series Forecasting?", <a href="http://arxiv.org/abs/2205.13504">arxiv:2205.13504</a>
<li>Hanlin Zhang, Benjamin L. Edelman, Danilo Francati, Daniele Venturi, Giuseppe Ateniese, Boaz Barak, "Watermarks in the Sand: Impossibility of Strong Watermarking for Generative Models", <a href="http://arxiv.org/abs/2311.04378">arxiv:2311.04378</a>
<li>Honghua Zhang, Meihua Dang, Nanyun Peng, Guy Van den Broeck, "Tractable Control for Autoregressive Language Generation", <a href="http://arxiv.org/abs/2304.07438">arxiv:2304.07438</a>
<li>Ruiqi Zhang, Spencer Frei, Peter L. Bartlett, "Trained Transformers Learn Linear Models In-Context", <a href="http://arxiv.org/abs/2306.09927">arxiv:2306.09927</a>
</ul>
<ul>To write, maybe, if I really want to embarrass myself:
<li>"Large Language Models in Statistical Perspective"
</ul>
<hr>
Previous versions: 6 May 2023, 1 June 2023; 4 June 2023; 17 October 2023