how a language model works in this chapter we follow what happens between the question we
type and the answer the assistant returns the path has three stages the text becomes a
sequence of numbers a function with billions of adjustable coefficients computes from those numbers the probability
of each possible continuation and a random draw picks what comes next much of the behavior
that surprises people who use these tools such as the fluent but wrong answer or the
easy agreement with the user comes from choices that become visible in the equations several of
these equations have an immediate reading for anyone who knows statistical physics and we will use
that reading whenever it explains something saying also where the analogy stops working the corresponding lesson
covers sections to without the proofs and from section it shows the transition from model to
assistant and sycophancy the preference calculation reasoning models and the causes of hallucinations stay in the
optional material of the slides the sections marked as further reading go beyond the lesson zipf
s law associative memory and its energy other physical readings and the scaling laws the optional
exercise in section uses the calculations of section elementary probability derivatives and vectors are enough the
core follows the lesson what the model computes and how it is trained why this recipe
took so long to work attention scale and tools by the end try to explain where
a piece of information came from and to redo the calculation of one attention head the
proofs about associative memory and the error bounds are further reading what a language model is
given a passage of text a language model assigns a probability to each possible continuation after
the capital of brazil is for instance a good model gives high probability to bras lia
and low probability to lisbon that is a language model is a probability distribution over sequences
of text everything an assistant does is built on this calculation in practice the model is
a mathematical function with many adjustable coefficients called parameters the situation is similar to curve fitting
we choose a functional form with free coefficients and adjust them so that the curve passes
close to the data here the data are texts and adjusting the parameters so that the
model predicts those texts well is what we call training the functional form is a neural
network a composition of many simple operations we multiply a vector by a matrix apply a
nonlinear function to each component of the result multiply by another matrix and so on the
parameters are the entries of those matrices current models are called large as in large language
models llms because they have billions of parameters fitted to collections of text with trillions of
words the assistants we use such as chatgpt claude and gemini are models of this kind
that went through additional stages of fitting to follow instructions they run inside an application with
tools files and memory we follow this path in order first the model that predicts the
next piece of text section why this recipe took so long to work section attention and
the transformer section then the physical readings section the fitting that turns the model into an
assistant section and finally the system around it section from text to probabilities tokens the model
is a function that takes numbers and returns numbers before any calculation therefore the text has
to become a sequence of numbers and for that we use a kind of numbered dictionary
we cut the text into pieces called tokens and each possible piece occupies a fixed position
in a list the model s vocabulary we call the number of entries in that list
a token can be a whole word a piece of a word a punctuation mark a
group of digits or a space consider a real case the program that does the cutting
is called a tokenizer and the one used by gpt o a model by openai splits
the portuguese sentence o campo magn tico varia lentamente the magnetic field varies slowly into the
seven tokens of table note that the space before each word is part of the token
that magn tico breaks into two pieces and that lentamente fits in one what enters the
model is the sequence of the numbers of these tokens and this is what the notation
means from now on is the number of the token that occupies position in the text
an integer between and this number works like the numbering of the entries in a dictionary
it identifies the token and its order has no meaning token is as far from as
it is from what each token represents for the model is stored in a vector associated
with it which we will see in section lr token number in the vocabulary o campo
magn tico varia lentamente the portuguese sentence o campo magn tico varia lentamente in the gpt
o tokenizer o k base whose vocabulary has about thousand tokens the symbol marks the space
that is part of the token tokens and numbers computed with the public tokenizer file we
could cut the text into whole words or into letters and both choices have problems a
vocabulary of whole words would need to list every word of every language with all their
inflections plus proper names numbers typos and commands and a word outside the list would have
no representation a vocabulary of letters would be small but every text would become a very
long sequence and the model would spend much of its work reassembling words from letters tokens
sit halfway frequent words take a single token and rare words break into pieces that are
in the list so that no text is left without a representation the vocabulary starts from
the lowest level of writing in a computer the byte a character is a written symbol
such as a or an emoji in the computer s memory each character is stored as
a short sequence of bytes and a byte is simply an integer from to written with
eight bits the correspondence between characters and bytes is fixed by a table the encoding in
utf used in almost all of the internet the letter a is the byte is the
pair is and most emojis take four bytes if the possible bytes are in the vocabulary
any text in any language can be written with it and a rare character that did
not get a token of its own enters the model in pieces for instance the symbol
when it appears in a text as a character takes three bytes the gpt o tokenizer
splits it into two tokens one with the first two bytes and another with the third
and neither of them alone is a character the vocabulary is built once before training from
a corpus the name we give to the collection of texts from which the model learns
books web pages papers code the most widely used method is byte pair encoding bpe the
rule is simple gpt a model released by openai in will serve as our numerical example
throughout the chapter because its parameters are public in the version of bpe used by it
and by many later models we start with a vocabulary that contains only the bytes and
write the whole corpus with them we count how many times each pair of neighboring symbols
appears in the corpus and merge the most frequent pair into a new symbol which enters
the vocabulary and is treated from then on as a unit then we rewrite the corpus
with the new symbol count again and repeat the merge until the vocabulary reaches the desired
size table shows the rule on a toy corpus with letters in place of bytes to
keep it readable the corpus has four different portuguese words campo field which appears twice tempo
time and tempos times three times each and templo temple once that makes nine words in
all at the start each letter is a symbol and the pair m p appears in
all nine so it becomes the symbol mp in the next count the most frequent pair
is mp o with eight occurrences because in templo the mp is followed by l after
five merges tempo and tempos the most frequent words have become whole tokens while campo stays
in three pieces and templo which appears only once in four to cut a new text
the tokenizer applies the merges in the order in which they were learned thus the word
campos which is not in the corpus becomes c a mpo s cccllll merge pair merged
count campo tempo tempos templo c a m p o t e m p o t
e m p o s t e m p l o m p c a mp
o t e mp o t e mp o s t e mp l o mp
o c a mpo t e mpo t e mpo s t e mp l o
t e c a mpo te mpo te mpo s te mp l o te mpo
c a mpo tempo tempo s te mp l o tempo s c a mpo tempo
tempos te mp l o five bpe merges on a toy corpus in parentheses how many
times each word appears in the corpus the count is the number of occurrences of the
merged pair each row shows how the four words are written after the merge and the
dot separates the tokens bpe was born as a data compression algorithm and sennrich haddow and
birch adapted it to cut words in machine translation in a real tokenizer the corpus is
enormous and the merge is repeated tens or hundreds of thousands of times gpt made merges
and added one special token which marks the end of a document giving the gpt o
vocabulary has about thousand tokens knowing that the model reads tokens explains some behaviors that surprise
people who use these tools in the question how many letters r are there in morango
portuguese for strawberry the word morango reaches the model as mor and ango and its seven
letters do not appear in the input to count them the model needs to know which
letters make up each token something it only learns indirectly from the training texts in the
same tokenizer numbers break into blocks of up to three digits and enters as which helps
to understand why calculations with long numbers are a weak point an equation in also becomes
a long sequence of fragments the divergence written j takes ten tokens and itself breaks into
n and abla indices and signs scattered over many fragments are another weak point finally the
size of a text for the model is its number of tokens the model can only
take into account a maximum number of tokens at a time its context window and paid
use is measured and billed in tokens when the corpus used to build the vocabulary is
dominated by english the same content in portuguese usually takes more tokens in a proportion that
depends on the text and on the tokenizer in the gpt o tokenizer the sentence in
table takes seven tokens and the same sentence in english six generation token by token and
the chain rule to understand what the model computes we follow one generation we call prefix
the text that has already been written given the prefix the model returns a probability distribution
over the next token that is a list with a number between and for each of
the tokens in the vocabulary summing to then we draw a token with those probabilities like
someone throwing a loaded die with faces append the drawn token to the prefix and repeat
table shows three steps starting from the prefix the magnetic with probabilities invented to illustrate the
mechanism in this simplification words play the role of tokens a real tokenizer could split them
lll prefix some probabilities illustrative token drawn the magnetic field moment others field the magnetic field
varies is others varies the magnetic field varies slowly in others slowly three generation steps with
illustrative probabilities note that at each step the prefix changes and with it the distribution while
the parameters of the model stay fixed throughout the generation the draw can pick a less
probable option and this is why the same question can receive different answers multiplying the probabilities
of the three drawn tokens we obtain the probability of the whole continuation this multiplication is
a case of the chain rule of probability theory for three tokens it says that that
is the probability of the sequence is that of the first token times that of the
second given the first times that of the third given the first two for tokens and
any distribution over sequences where is the prefix of position is the probability of token given
that prefix and collects all the parameters of the model the equality is an identity and
holds without any independence assumption because each factor can depend on the whole preceding text that
is to obtain the probability of any text it is enough to predict the next token
given the prefix and this is what the network computes generation runs through factor by factor
as in table cross entropy relative entropy and perplexity so far we have assumed the model
was ready now we see how the parameters are chosen that is what training is the
idea is simple we go through the corpus and at each position ask what probability the
model assigned to the token that actually came next a good model gives high probability to
the true token by the chain rule the probability the model assigns to the whole corpus
its likelihood is the product of these probabilities an astronomically small number so we work with
its logarithm which turns the product into a sum and divide by the number of positions
in the corpus with a minus sign so that the result is positive we obtain the
average of over the positions called the loss training means searching for the parameters that make
this loss small and minimizing the loss is the same as maximizing the likelihood each term
of the sum measures the model s surprise at one token if the model gave probability
to the correct token the term is if it gave it is with the natural logarithm
the loss is measured in nats with the base logarithm it would be measured in bits
each position of the corpus contributes one term to the sum and section shows why the
terms of a whole stretch of text can be computed in a single pass over it
the minimization is done by gradient descent we compute the derivative of the loss with respect
to each parameter the gradient and change all the parameters a little in the direction in
which the loss decreases for a parameter each step makes where the learning rate is a
small number chosen by whoever trains the model in practice the corpus is cut into stretches
the size of the context window and each step computes the gradient on a batch of
randomly drawn stretches with millions of tokens instead of the whole corpus this is why the
method is called stochastic gradient descent then we repeat with other batches millions of times it
is the dynamics of a particle with a lot of friction in a potential always going
down along the steepest slope section returns to this procedure to estimate the cost of training
to see what training produces we will reorganize the sum each term depends on only two
things the prefix which we call here the context and the token that came after it
positions with the same context and the same next token contribute equal terms and we can
group them we call the fraction of the positions of the corpus where the context is
and the fraction of those positions where the next token was that is the frequency of
after token follows context in positions all with the same term and the loss becomes where
the first sum runs over the distinct contexts of the corpus we have only changed the
order of the terms but now the bracket has a direct reading it is the model
s average surprise in context when the next tokens appear with the corpus frequencies the loss
is the average of these brackets and each context weighs the fraction of the positions where
it appears the bracket is a case of a quantity with a name of its own
for two distributions and over the same symbols the average of with the symbols drawn from
is the cross entropy between and adding and subtracting in each term it splits into two
parts the first term is the shannon entropy of it depends only on and measures the
uncertainty that exists in the data themselves the second is the relative entropy or kullback leibler
divergence and measures the extra surprise of someone who uses when the symbols follow this extra
surprise is never negative in fact since with equality only at we have with the sums
restricted to the symbols with equality requires for all of them that is with only when
a result known as gibbs inequality now we only need to apply to the bracket of
each context with and where the dot stands for the list of values for all the
tokens of the vocabulary the bracket of context splits into the entropy of the frequencies and
the divergence between these frequencies and the model s probabilities we obtain and this is the
relation between the loss and the decomposition the first term is the average entropy of the
corpus frequencies and does not depend on therefore training can only reduce the second and the
lowest possible loss is the average entropy reached when in every context that is when the
model reproduces the corpus frequencies for instance if a context appears followed three times by token
a and once by token b we have and with nat a model that gives probability
to each of the two tokens has in this context a loss of nat per position
and the difference nat is the value of for this model with and the loss falls
to nat and vanishes the example training reproduces frequencies at the end of this section reaches
the same result by minimizing the loss directly in a real corpus this calculation has a
consequence we need to understand a long context almost never repeats and then puts all the
weight on the single token that came after it with zero entropy the lowest loss on
the corpus would be practically zero that of a model that memorized the text in practice
training stays far from this minimum because the same parameters serve all contexts adjusting them to
get the next token right in one context also changes the predictions in similar contexts and
what training manages to reduce are mainly the errors common to many contexts that is the
regularities of the text this is what allows the model to be right on texts it
has never seen although it can also memorize passages that are repeated many times in the
corpus this is why what matters is the loss on texts left out of training the
test loss of section if we think of the corpus as a sample from a source
a random process that produces texts the decomposition holds for this loss with the probabilities of
the source in place of the corpus frequencies the first term becomes the entropy of the
source the uncertainty about the next token that remains even for someone who knows all the
preceding text and no model goes below it it remains to understand why the average over
a corpus tells us something about the source successive positions of a text are correlated like
successive instants of a trajectory and the justification is the same as in statistical mechanics where
the time average along a long trajectory replaces the ensemble average in a stationary and ergodic
system for texts these properties are assumptions about the source its statistics do not change along
the text and a long stretch is representative of the whole source with them and with
a large corpus the average of a fixed model approximates its expected loss on new texts
but training fits the model to the corpus itself and that is why the test loss
is computed on texts left out of training a loss in nats is hard to interpret
and so we also use the perplexity which translates it into a number of choices a
model that spreads uniform probability over continuations has loss and therefore in the continuation of table
nats over three tokens give nat per token and that is in these three steps the
model behaves as if it were choosing on average between two equally probable options the task
of predicting the next symbol is older than today s computers shannon estimated the entropy of
the source for written english by asking people to guess the next letter of a text
with a context of up to letters he arrived at something of the order of bit
per letter which corresponds to a redundancy of about text uses close to four times more
letters than the minimum needed to carry the same information an llm is trained on the
same task using the whole corpus umegaki s relative entropy is the noncommutative version of with
equality only for araki extended the definition to states of general von neumann algebras by means
of the relative modular operator which makes it available for the type iii algebras of quantum
field theory where there are no density matrices uhlmann proved monotonicity relative entropy decreases under operations
that lose information the classical version has the same property and grouping tokens or discarding context
never increases the training objective of an llm is the commutative and discrete case of this
family the same context appears four times in the corpus followed three times by token a
and once by token b the model assigns probability to a and to b the total
loss over the four occurrences is with given in so the factor of does not alter
the minimum the fit reproduces the corpus frequency as predicts and at the minimum the loss
per position is the entropy nat with with arbitrary counts the same calculation with a lagrange
multiplier gives the objective function depends only on the frequencies and whether a or b is
true does not enter the calculation if a misconception is frequent in the corpus the model
learns the misconception we write in the example with three a and one b so that
the model has a single parameter differentiating the total loss of the previous example with we
obtain starting from we have and gradient a step with learning rate produces the total loss
drops from to nats per position it goes from to nat since the entropy nat does
not depend on the step reduced from to nat we have not yet reached the optimum
more steps approach the minimum in a network many contexts share the same parameters this sharing
makes it possible to learn regularities and apply them to new contexts the one parameter model
illustrates the fitting but on its own it does not describe the ability of an llm
to generalize why the recipe took so long to work the recipe of the previous sections
is old in shannon was already generating texts by drawing each word with the frequency with
which it follows the previous one and the result has plausible word pairs and nonsensical sentences
in the lesson we show a text drawn this way from the portuguese notes of this
course with the program codigo shannon py the question of this section is why the same
recipe predicting the next piece from text statistics took so long to yield what we see
today the first obstacle is the number of contexts a table storing for each prefix the
frequency of each following token would need one row per prefix and the number of prefixes
grows exponentially with their length with the gpt o vocabulary of about tokens there are sequences
of ten tokens almost all of them meaningless but even plausible texts are too numerous shannon
estimated that written english carries about one bit per letter and a token has on average
a few letters counting only one bit per token there are more than plausible hundred token
paragraphs whereas the largest model of meta s llama family was trained on trillion tokens about
that is almost every long context a model encounters never appeared in training and a frequency
table would have nothing to say about it the model needs to generalize treating similar contexts
similarly including ones it has never seen the way out proposed by bengio and collaborators in
is to replace each word by a vector of real numbers adjusted during training so that
words used in similar ways stay close together and to make the prediction with a function
of those vectors what the model learns about electric then carries over in part to magnetic
and a new context looks close to known contexts that vector is the embedding which we
will examine in detail in section but the vector of each word alone is not enough
because the meaning of a word depends on the others the token campo field is the
same in far from the wire with current the field varies slowly and in after the
rain at the stadium the field grew muddy and enters the model with the same vector
in both sentences what follows is very different and the information that settles the meaning sits
in earlier sometimes distant words the networks most used for text until recurrent networks read text
one word at a time and kept the past in a vector of fixed size updated
at each word they worked like a reader allowed to carry forward only a short note
summarizing what had been read so far what lay far back faded from the note training
also had to follow the order of the text word by word without computing all positions
at once attention without recurrence the subject of the next section solves both problems each position
looks directly for what it needs and none waits for the summary of the preceding one
attention and the transformer we already know what the model computes a distribution for the next
token and how the parameters are fitted what remains is the function itself that is the
calculation that leads from the sequence of token numbers to that distribution we start with the
whole path and then look at each stage in turn the calculation has three stages figure
in the first each token of the text is replaced by a vector of real numbers
its embedding with tokens we have vectors which we store in the rows of a matrix
one row for each position of the text in the second stage this matrix is transformed
several times each transformation receives a matrix with rows and columns and returns another of the
same size still with one vector per position and it is called a block the model
applies blocks one after the other and the output of each block is the input of
the next calling the matrix that comes out of block the second stage is the sequence
where each arrow is a block all blocks do the same kind of calculation but each
one has its own parameters in the third stage the vector of the last position which
is in the last row of is converted into a list of numbers one for each
token in the vocabulary and this list becomes the probability distribution of the next token each
block makes two corrections to the vectors one after the other in the first the vector
of each position receives a correction computed from itself and from the vectors of the previous
positions this operation is called attention and it is the only one in the model in
which different positions exchange information it is through attention that the vector of varies in the
sentence the electric field varies can come to carry information about field in the second the
vector of each position receives another correction computed from it alone by a small neural network
that treats each position separately the feed forward network or ff the path of one generation
from the text to the next token which goes back into the sequence this architecture is
called the transformer it was proposed in by vaswani and collaborators in a paper on machine
translation the language models that generate text today generally use a simplified version of it which
is the one we will describe and the relation between the two appears in section there
are other architectures such as the state space models of the mamba family next we look
at each piece in the order of the path embeddings and position we begin with the
first stage the replacement of each token by a vector in section we saw that the
number of a token is only a label like the numbering of the entries of a
dictionary this number is not suitable for calculations if it entered the network directly token campo
field would be closer to token than to token o the and this closeness means nothing
at all so we associate with each token in the vocabulary a list of real numbers
that is a vector in called the embedding of the token the vectors form a table
the matrix with one row for each token and the token with number is represented by
row which we call replacing a token by its vector is just looking up the corresponding
row of the table the numbers in the table are not chosen by hand the entries
of are parameters they start out random and are adjusted in training like the other parameters
of the model at the end of training tokens that appear in similar contexts tend to
have nearby vectors the words magnetic and electric for instance appear in the same places in
physics texts and what tends to come after one resembles what comes after the other since
the two should lead to similar predictions training tends to give them nearby vectors in the
smallest version of gpt which we will call the small gpt in large models is of
the order of thousands nobody decides what each component means the values come out of training
and no axis needs to correspond to a property we know how to name the embedding
still does not say at which position of the text the token is the vector of
dog is the same at any position and the sentences the dog bit the man and
the man bit the dog would give the same vectors only in swapped rows but order
matters because the two sentences say different things for the model to be able to tell
them apart the position of each token has to be in the vector itself the simplest
choice adds to the embedding a position vector with the same components that depends only on
the position where is the number of the token at position and is row of the
matrix that is the vector that enters the first block at position so the same token
at different positions now has different vectors it remains to choose the vectors the original transformer
uses sines and cosines the components of are grouped in pairs and pair number is with
each pair is a clock hand that turns with the position with frequency and the vector
is like a clock with hands turning at different speeds the fastest hand makes a full
turn every positions and distinguishes neighboring positions the slowest takes about thousand positions to make a
turn and distinguishes distant positions any choice of distinct vectors would distinguish the positions but this
one has a useful property going from position to rotates each hand by the angle which
depends only on the distance so the relation between and is the same anywhere in the
text and the model can learn to look for example for the token that is positions
back wherever it is the same idea reappears later inside attention gpt makes another choice it
treats the as parameters and learns them in training one vector for each of the positions
of its context window many current models add no position vector at all and encode the
position inside attention itself a solution we will see in section in the sentence of table
campo with its leading space has label in an illustrative model with the corresponding row of
the table could be if the vector of position were we would have these vectors are
invented the labels in the table come from the real tokenizer placing the seven vectors in
the rows of a matrix we obtain the label selects a row the position adds order
and the following blocks make each representation depend on the context attention after the first stage
the vector of each position depends only on its token and its position the vector of
varies in the electric field varies is the same in any text in which varies appears
in the fourth position but to predict what comes after varies the model needs to know
what varies and this information is at another position attention is the operation that brings into
the vector of each position information from the others the simplest way to gather information from
several positions is a weighted average to update the vector of varies attention computes an average
of vectors associated with the four positions with positive weights that add up to the weights
could be for example for the for electric for field and for varies itself figure the
average is dominated by the contribution of field and the vector of varies comes to carry
information about its subject the numbers in the figure are illustrative and the worked example later
in this section shows where they come from note that the weights are computed from the
vectors themselves and change from one text to another in a trained model varies may give
more weight to field the subject of the verb because this information helps to predict what
comes next note also that the average for varies uses only varies and the previous positions
in a model that generates text this restriction holds at every position the average at position
uses only the positions the reason is that the text is generated in order one token
after the other when the model computes what comes after field the word varies has not
been written yet and the vector of field cannot depend on it attention with this restriction
is called causal the vector of each position depends only on what came before it and
on itself the idea of attention with illustrative weights the new vector of varies receives a
weighted average of the vectors of the four positions and the thickness of each arrow follows
its weight the dashed arrow indicates a forbidden dependence the vector of field cannot use a
following position such as varies we still need to say how the weights are computed for
each pair of positions the model computes a real number the score which measures how much
position matters to position the scores can have any sign and to become weights they go
through two operations we take the exponential of each one which makes them all positive and
divide by the sum which makes the weights add up to this recipe is called the
softmax it preserves the order of the scores and the exponential sharpens the differences with two
scores and the exponentials are and and the weights and readers who know statistical physics will
recognize the boltzmann factor here fixing position and writing the weights of that position form the
canonical distribution over the positions of the text and the average attention computes is a thermal
average dominated by the lowest energy positions the ones that matter most to position the analogy
has limits there is no heat bath and each position has its own distribution with energies
that the model computes from the vectors using matrices fitted in training we return to this
reading in section what remains is how the score is computed from the vectors the simplest
measure of affinity between two vectors is the scalar product and we could take where is
the current vector of position written as a row but the scalar product measures similarity and
each position would tend to give more weight to itself and to tokens similar to it
the verb varies would look for other verbs when what it needs is its subject and
the content a position hands over when it is chosen does not need to be the
same vector that serves to find it either this is why the transformer computes from the
vector of each position three different vectors each with its own matrix of parameters with the
same three matrices at all positions that is each of the three vectors is a linear
combination of the components of with coefficients given by the corresponding matrix and the example below
does this calculation for the values the query represents what position is looking for the key
what position offers in order to be found and the value the content that position hands
over to whoever finds it the picture is that of a card index we compare the
query with the label of each card which is the key and copy the content of
the cards which are the values in the proportion in which the labels match the query
since the three matrices are adjusted in training it is training that decides what each position
looks for and what it hands over the dimension of these vectors can be smaller than
putting the pieces together the score is with a factor that we explain shortly and the
weights and the output of position are where the sums run only over the positions as
the causal restriction requires for the weight is zero the output is the weighted average of
the values and from it comes the correction added to the vector of position as we
will see in section note that this sum does not depend on the order of its
terms without position information in the vectors the output would be the same for any order
of the previous positions and this is what the vector of section corrects the calculation of
and with its three matrices is called an attention head in section we will see why
models use several of them we now do the calculation for position varies in the sentence
the electric field varies slowly in a toy model with and and with vectors invented so
that the calculations are simple we start with the values suppose that the current vectors of
the five positions are for the for electric for field for varies and for slowly and
that the value matrix is by each value is the vector of the position multiplied by
and we obtain and each is the content that position hands over for the average and
the matrix adjusted in training decides which part of the information in each vector enters this
content the queries and keys come out in the same way with the matrices and and
the scores from we directly assume the energies which take the values the first four are
those of the lesson they are not independent of the vectors since keys are linear in
the energies are too so the vector for slowly cannot be for instance a multiple of
that of varies whose energy it would multiply in training the whole sentence is present yet
position is the one position has to predict it stays outside the sums in which is
equivalent to replacing its energy by because to two decimal places the boltzmann factors of the
remaining four positions are with sum and we obtain the weights and with them the average
of the values the energy and the value do not enter if they did slowly would
take more than half the weight and the output would jump to the vector is the
information that the position varies gathers from itself and from earlier ones and from it comes
the correction added to the vector of varies position consults itself and the past in order
to predict the token at position which remains hidden if only changes to in the example
do the weights change no keeping queries and keys fixed the weights remain and the output
becomes now we see why the factor appears larger scores concentrate the weights if the energies
of the example doubled the weights would go from if the components of and are independent
with zero mean and unit variance the product a sum of terms has variance without the
factor the scores would grow with the dimension and the softmax would give weight close to
to one position and close to to the others in this regime small changes in the
scores barely change the weights and gradient descent which depends on those derivatives gets stuck in
the boltzmann factor plays the role of an inverse temperature and doubling the scores is halving
the temperature the weights of all positions of the electric field varies can be collected in
a matrix with rows and columns in the order the electric field varies we have the
first row is because the can only use itself the second and third come from the
energies and also invented and the last row is that of the example and of figure
each row adds up to and the weights above the diagonal are all zero because no
position uses the future so far we have done the calculations position by position in papers
and in the computer they are done for all positions at once with matrices placing the
vectors of the positions in the rows of a matrix the queries keys and values sit
in the rows of and the matrix has in row and column the product that is
it collects all the scores and attention is written where the softmax is applied to each
row separately the notation is the usual one in the literature and the of the value
matrix has nothing to do with the size of the vocabulary the matrix is the causal
mask it adds to the scores of future positions as we did in the example and
these positions receive zero weight figure that is the mask is the restriction of written for
the whole matrix and for the electric field varies the softmax of is the weight matrix
above queries and keys determine the weights and the values are what gets combined each attention
head computes with its own matrices and causal mask row only assigns weight to the keys
the scores above the diagonal are and receive zero weight in the softmax the mask has
an important consequence for training in generation only the final vector of the last position becomes
a distribution in training the third stage of the path is applied to all the rows
of in a stretch of tokens the final vector of position gives the distribution of token
and the token that actually came provides one term of the sum the mask ensures that
this vector depends only on the positions without looking at the answer since each row of
depends only on the vectors that enter the block all the rows can be computed at
the same time and a single pass over the stretch produces the predictions at once each
conditioned only on its own prefix but in generation there is no such shortcut each drawn
token has to enter the prefix before the next one is computed the transformer and today
s models with attention in hand we can see what the transformer brought that was new
the machine translation systems before used recurrent networks some of them already equipped with an early
form of attention a recurrent network reads the sentence one token at a time and summarizes
what it has read in a single vector of fixed size its state which is updated
at each token the information in the first token only reaches the last one after going
through all the intermediate updates and training has to follow the order of the sentence one
token after the other in the transformer the vector of position uses the vector of each
previous position directly without intermediaries and as we saw at the end of section all the
positions of a training sequence are computed at the same time this makes good use of
graphics processors which are built to run many calculations in parallel and made it feasible to
train larger models on more text the transformer translated sentences and therefore had two parts each
made of several blocks the first the encoder processed the original sentence for example o campo
el trico varia since this sentence is known in full from the start attention there did
not have the causal restriction the vector of campo could use o as well as el
trico and varia the second part the decoder wrote the translation the electric field varies one
token at a time as in table there the causal restriction held because the translation was
still being written and the vector of field could only use the electric and field itself
each block of the decoder also had a second attention in which the queries came from
the translation and the keys and values from the vectors the encoder computed for the original
sentence this is how the choice of each word of the translation took the whole original
sentence into account in a model like gpt short for generative pre trained transformer there is
no original sentence separate from the answer the user s question and the model s answer
form a single text which the model continues token by token and the same holds for
the texts of training so the part that writes is enough the models of the gpt
family and most of the llms that generate text today use only the decoder without the
second attention that is a sequence of blocks with causal attention this is the version we
describe in this section several heads cost and relative position an attention head computes for each
position a single weighted average but the vector of varies may need at the same time
information about the subject and about the topic of the text which sit at different positions
and a single average tends to mix the two this is why each block uses several
heads in parallel each with its own matrices and and therefore with its own weights each
head produces at each position an output with components with heads we use so that the
total cost is that of a single head with components the outputs are then placed side
by side again forming a vector with components and a last matrix mixes the contributions of
the heads the result is the correction the block adds to the vector of the position
in the small gpt and there are heads each with different heads learn different relations one
example we know in detail is the induction heads suppose the text already contains harry potter
and that further on harry appears again at the position of the second harry an induction
head gives a high weight to the position that came right after the first harry that
of potter and copies that information from there which raises the probability of potter as the
next token for this it relies on another head in an earlier block that copies into
the vector of each position the information about the previous token so the vector of potter
comes to carry the information that it came after harry and this is the information that
the key of potter offers to the query of the second harry this mechanism underlies part
of in context learning the ability to follow patterns and examples that are in the text
of the conversation itself without any change in the parameters using all the previous positions directly
has a price in a text of tokens each head computes a score for each pair
of positions of the order of scores and adding up all the heads the number of
operations of grows as per block doubling the length of the text quadruples this cost and
this is what makes long contexts expensive in generation there is a saving because of the
causal restriction the vector of each position does not depend on the tokens that come after
it and so nothing changes at the previous positions when a new token enters the prefix
the keys and values of those positions can then be kept in memory in the so
called key value cache each new token only computes its own query key and value and
compares its query with the stored keys now we can return to position many current models
use rope for rotary position embedding which takes the clock of section inside attention nothing is
added to the embedding the components of the query and of the key are grouped in
pairs and at position each pair seen as a vector in the plane is rotated by
the angle with frequencies chosen in the same way as those of the hands of the
clock the scalar product between two plane vectors rotated by angles and depends on these angles
only through the difference for this reason the score between the query of position and the
key of position depends on the positions only through the distance that is attention sees relative
distances to link varies to field it is enough to know that field is one position
before wherever the sentence sits in the text blocks and the residual stream with attention ready
we can assemble a whole block as we saw at the beginning of the section each
block makes two corrections attention which brings in information from other positions and a second operation
which treats each position separately the model applies blocks in sequence all with the same form
and each with its own parameters in papers the blocks are also called layers and the
number the depth of the model is in the small gpt and reaches about a hundred
in large models a block of the type used in current language models applies where is
the matrix that enters the block in block and is the one that comes out ln
is a normalization of the vectors mha is the multi head attention of section and ff
is the small neural network that treats each position separately the abbreviations come from layer normalization
multi head attention and feed forward the two equalities follow the same scheme they normalize the
vectors compute a correction and add it to what was already there we now look at
ln and ff the normalization acts on the vector of each position separately it subtracts from
the components of their mean and divides by the standard deviation of those components so that
the result has components with zero mean and unit variance then it applies a scale and
a shift vectors learned in training the symbol denotes the componentwise product in practice a very
small number is added to to avoid division by zero in this way attention and ff
always receive vectors in a similar range of values in any block which stabilizes the training
of models with dozens of blocks the feed forward network makes the second correction it also
acts on the vector of each position separately in three steps the matrix takes the vector
from to components the nonlinear function is applied to each component and the matrix returns to
components in the small gpt there are components at the input in the middle and at
the output attention moves information between positions and ff processes the information that is already in
the vector of each position without ff would reduce to an affine transformation and it is
that widens what it can represent the full transformer would still be nonlinear since attention and
normalization also depend nonlinearly on the input in gpt is a smooth version of these networks
hold most of the parameters of each block as we will see in section geva and
collaborators showed that they function as key value memories each row of recognizes a pattern in
the vector the key and the corresponding column of adds to the vector the content associated
with that pattern the value in lower blocks the patterns are superficial and in higher ones
semantic in those higher blocks the values favor the tokens that tend to come right after
the pattern note the sums in each stage computes a correction from the vectors and adds
it to the vectors themselves figure so the vector of each position is preserved from block
to block and only receives additions these residual connections make it easier to train networks with
many blocks training needs the derivatives of the loss with respect to the parameters of all
the blocks and by the chain rule of calculus the derivative with respect to the input
of a block is a product of factors one for each block that comes after it
with the sums each factor has the form because the derivative of is without them it
would be just and the product of many small factors would shrink quickly the term lets
the derivatives cross the model even when the derivatives of the transformations are small a block
with the normalization before each stage each stage computes a correction from the vectors and adds
it back to them we can read this additive structure dynamically since each block only adds
corrections the vector of each position works as a register that the blocks one after the
other read and update this register is called the residual stream combining the two corrections of
block into one each block does like an euler step of a differential equation in which
the depth plays the role of time the state is the whole matrix because the correction
of each position depends through attention on the previous positions lu and collaborators carried this reading
further for them the positions are particles attention is the interaction between them and ff is
a single particle term the block takes an euler step with lie trotter operator splitting first
the interaction then the single particle term replacing lie trotter with strang marchuk splitting which has
smaller local error they arrived at a block with one ff before and one after attention
which outperformed the original transformer in their experiments this dynamical reading is the starting point of
section output and sampling we now reach the third stage in generation after the blocks the
vector of the last position has to become a distribution over the next token in training
the same calculation is done at all positions as we saw at the end of section
it goes through a final normalization and is multiplied by the matrix which produces a real
number for each token in the vocabulary its logit often that is the same embedding table
is used at the output and the logit of token is the scalar product of the
final vector with the embedding the largest logit goes to the token whose embedding has the
largest scalar product with the final vector the logits become probabilities through a second softmax where
is the temperature in training in generation is chosen by whoever uses the model with small
the probability concentrates on the tokens with the largest logits and with large it spreads over
the vocabulary the example in section shows the numbers note that this is the second softmax
of the model the one in attention in distributes weight among positions of the sequence and
this one distributes probability among the tokens of the vocabulary section reads this second softmax as
a canonical ensemble and section relates the first one to an associative memory before the draw
many systems cut off the tail of the distribution the tail is made of thousands of
unlikely tokens that added together still carry weight in a vocabulary of thousand tokens for example
if a hundred thousand of them have probability each together they add up to and one
draw in five would land on one of them the top cut keeps only the most
probable tokens the top cut keeps the smallest set of tokens whose summed probability reaches in
the first row of table with field and moment remain which add up to and the
other tokens are discarded in both cuts the remaining probabilities are renormalized to add up to
in the example and become and the drawn token goes back into the prefix and the
path of figure starts again if we raise the output temperature does the answer become more
truthful no we change the selection probabilities without adding evidence number of parameters and the cost
of training with the pieces described we can count the parameters in each block each head
has three matrices since the matrices and of all the heads add up to parameters and
with they make ff has one matrix and one matrix another ignoring the terms proportional to
such as the vectors and each block has parameters with blocks vocabulary and a maximum context
of positions we add the embedding tables of the tokens and of the positions and obtain
the total number of parameters for the small gpt and give million parameters in the blocks
and million in the embedding tables about million in total the published value the cost of
training also comes out of an order of magnitude calculation in the literature denotes the number
of parameters as above and not the number of positions in the number of training tokens
will be as we saw in section each step of gradient descent uses a randomly drawn
batch from the corpus and current models use variants such as adam that adjust the step
size of each parameter we now count the operations per token almost all the parameters are
entries of matrices and in a matrix vector multiplication each entry takes part in one multiplication
and one addition the forward pass the calculation of the probabilities then takes about operations per
token backpropagation the calculation of the gradient runs through the network from back to front applying
the chain rule of differential calculus in each matrix it computes the derivatives with respect to
the input and with respect to the parameters each at a cost similar to that of
the forward pass and so it costs about twice as much about training on tokens then
requires floating point operations which are multiplications and additions of real numbers in the computer for
gpt with billion parameters and billion training tokens the calculation gives operations practically the reported by
the authors a current graphics processor performs of the order of operations per second and would
take alone about a decade this is why training uses thousands of them in parallel the
estimate returns in section parallel training and scale attention also changed the scale of training since
no position depends on a summary computed at the previous one training computes the predictions for
all positions of a stretch in the same pass and the mask guarantees that each position
predicts the next word without seeing it as we saw at the end of section the
recurrent networks of section had to run through the stretch serially one position after the other
graphics cards built for many simultaneous calculations execute that calculation well in parallel and training moved
on to trillions of tokens kaplan and collaborators measured in models from to billion parameters without
counting the embeddings how the loss drops with model size data and compute in all three
cases the drop is a power law in the number of parameters a straight line on
a log log plot that is improvement with size was predictable which gave grounds for betting
on even larger models such as gpt in with billion parameters gpt from had billion the
lower loss came with more successes on new tasks as the authors of gpt showed the
loss has a floor the entropy of the text itself which the form of hoffmann and
collaborators includes but the fit was measured over a range of sizes and using it for
much larger models is an extrapolation section gives the full laws and the discussion of how
to split compute between parameters and data physical readings several pieces of the transformer have the
form of objects we know from statistical physics the output softmax is a canonical ensemble attention
takes a step in an associative memory and the depth of the network plays the role
of time in this section we use these correspondences to understand the model always saying where
they stop working the softmax as a canonical ensemble consider the output softmax if we treat
each token in the vocabulary as a state of a physical system and minus its logit
as the energy of that state it becomes the boltzmann distribution of a canonical ensemble with
states at temperature with this reading the identities of thermodynamics hold without modification with each of
these quantities says something about the draw of the next token the mean energy is minus
the mean logit the entropy measures the uncertainty of the draw it is zero when a
single token has probability and when all are equally probable and is the effective number of
tokens in contention in the same sense as the perplexity of section the second line connects
fluctuation and response the variance of the energy measures how much the distribution reacts to a
change in temperature the limits also have a direct reading when the weight concentrates on the
token with the largest logit the ground state if it is unique always choosing the most
probable token is greedy decoding if there is a tie among the largest logits the limit
splits the weight among them and breaking the tie is an additional rule when all tokens
become equally probable and note that the logits are defined up to an additive constant like
the zero of energy adding the same constant to all the multiplies by a factor and
leaves the probabilities unchanged with scores the probability of the first alternative is cccc we see
that the same table of logits generates different distributions training determines the logits and the temperature
changes only the distribution used in the draw the temperature of the softmax is a sampling
parameter chosen by whoever uses the model nothing in the system corresponds to a heat bath
or to a dynamics leading to equilibrium and the energies change at every token because they
depend on the whole preceding context the heat capacity measures the sensitivity of the distribution to
and it is a useful diagnostic with no thermodynamic process behind it zipf s law and
criticality zipf s law describes the frequency of words in a text we order the words
from the most frequent to the least frequent and call rank the position of each one
in the list in texts of many languages the frequency of the word of rank falls
roughly as the second most common word appears about half as often as the first the
third about a third as often and so on consider what happens to an ensemble whose
probabilities follow a law of this kind suppose that the logit of the token of rank
is with that is that the energy grows with the logarithm of the rank for the
boltzmann distribution is then a zipf law with exponent for the partition function is the riemann
zeta function finite for and divergent for we can understand why by counting states as in
the microcanonical ensemble the energy lies below for so there are states with energy below and
the entropy of the spectrum is a straight line the microcanonical temperature is the same at
all energies at the temperature the boltzmann factor falls exactly as fast as the number of
states grows below it the boltzmann factor wins and the ensemble concentrates on the first tokens
above it the number of states wins and the probability escapes into the tail limited only
by the size of the vocabulary mora and bialek discuss this equivalence between zipf s law
and criticality in biological systems with finite nothing diverges and the transition becomes a rounded peak
in the heat capacity this peak approaches and becomes higher as grows the finite size signature
familiar from any course on critical phenomena lccccc figure shows and for the size of the
gpt vocabulary but the spectrum is illustrative real logits depend on the context and do not
follow an exact power law the optional exercise in section asks for the same calculation with
the logits of gpt illustrative zipf spectrum with the peak of at is the finite size
version of the transition at attention as associative memory an associative memory retrieves a stored pattern
from an incomplete or corrupted version of it as when we recognize a piece of music
from a few notes in hopfield proposed a physical model of this kind a network of
binary neurons variables coupled in pairs like spins in an ising model to store patterns with
the couplings are chosen by hebb s rule and the energy is with few patterns each
of them is a minimum of the energy a pattern is retrieved when the dynamics starting
from a corrupted version of it goes down to that minimum for random patterns the capacity
the number of patterns the network can store and retrieve is about patterns per neuron krotov
and hopfield showed that higher order interactions greatly increase this capacity and ramsauer and collaborators arrived
at a continuous version with capacity exponential in the dimension in this version the patterns are
vectors stored in the columns of a matrix the state of the network is a vector
and the energy is the first term is a smooth version of to which it tends
when and it becomes more negative the more aligns with some pattern the second term keeps
from growing without bound the gradient is with and the update rule is exactly the attention
of for a single query which can use all the patterns with keys and values equal
to the patterns and in place of the weights are the softmax of the scalar products
between the query and the patterns and the new state is the weighted average of the
patterns that is under these conditions an attention operation takes one descent step in an energy
whose minima are the memories hopfield shared the nobel prize in physics with hinton and the
committee s scientific background document is a good introductory reading the energy goes down at every
step we now show that the update never increases the energy write with and the function
is convex because it is the logarithm of a sum of exponentials of linear functions of
and its gradient is the weighted average of the patterns a convex function always lies above
its linear approximation and so therefore the energy drops at every update and only stops dropping
at the fixed points this is the argument of the concave convex procedure with initial state
and the weights are and the energies are and and the drop lies below as inequality
requires iterating the state goes through and and converges to the symmetric mixture the memory is
not retrieved an exact calculation shows why with the update gives which for is the curie
weiss equation of the mean field ising model near the mixture the mixture attracts for for
it becomes unstable and two fixed points appear close to the memories and leads to that
is retrieval is a spontaneous symmetry breaking controlled by the descent of the energy holds for
the update fixed patterns values equal to the keys all in the same space a trained
transformer has distinct projections several heads ff networks normalization and residual connections the result says nothing
about a global energy going down along the full model the correspondence is exact only for
an isolated attention operation under the conditions above other physical readings the potts model in a
potts model each site of a lattice takes one of several colors and the energy is
a sum of terms that depend on the pairs of sites and their colors the ising
model is the case of two colors rende gerace laio and goldt take the sites to
be the positions in the text and the colors to be the tokens they study a
simplified version of attention called factored attention in which the weights depend only on the positions
and the values only on the tokens and show that it learns the conditional distributions of
a generalized potts model that is the probability of the color of a site given the
colors of the others training this layer is exactly equivalent to solving the inverse potts problem
which is inferring the couplings from samples by the pseudo likelihood method which fits these conditional
probabilities the correspondence makes it possible to compute with the replica method the generalization error which
is the error on data the model did not see in training interacting particles on the
sphere the dynamical reading of section treats depth as time geshkovski letrouit polyanskiy and rigollet take
this idea to the limit of continuous time in a simplified model in it the vectors
of the positions lie on the unit sphere the query key and value matrices are the
identity and there is no ff the sphere comes from the normalization of section without the
learned scale and shift and neglecting the small number added to it produces vectors of fixed
norm and a change of scale makes that norm equal to in a real transformer only
the inputs of each stage are normalized and the residual stream does not lie on a
sphere the dynamics is where is the sum of the weights which normalizes them and projects
onto the plane tangent to the sphere at which keeps each vector on it each vector
moves in the direction of a weighted average of the others with boltzmann weights larger for
the vectors that are already close that is the tokens are particles that attract each other
the authors show that in several regimes they cluster at long times passing through metastable states
in a phenomenon related to synchronization in the kuramoto model the simplification is strong with the
same parameters in all layers and no ff but it makes it possible to formulate precisely
a concrete question why the representations of different tokens tend to align in deep networks superposition
and high dimensional geometry a model needs to distinguish many features of the text such as
this passage is code this word is a proper name or the sentence is in the
past tense if each feature occupied a direction of its own orthogonal to the others at
most of them would fit in but if we accept nearly orthogonal directions with between any
two of the order of of them fit where is a constant a number that grows
exponentially with the dimension indeed two vectors drawn at random in have a cosine of order
which for is about models exploit this slack to represent more features than dimensions with nearly
orthogonal directions and a little interference between them this works well when each feature appears rarely
because then few are present at the same time and the interference stays small this form
of representation is called superposition superposition has a direct consequence for anyone trying to interpret a
model a neuron that is one of the components computed in the middle of the ff
network of section usually responds to several unrelated features this is why the analysis looks for
directions in the space of internal vectors which can combine many components the attribution graphs of
lindsey and collaborators follow this line and show for a given answer which internal features contributed
to it and through which paths in a production model from model to assistant the model
that comes out of the training of section is called pretrained and it only continues texts
if we write a question it may continue with another question as in a problem set
because that is often what comes after a question in the texts of the corpus to
answer questions and follow instructions it goes through two more stages in the first supervised fine
tuning training continues with the same loss on examples of dialogues written by people with questions
and good answers in the second preference optimization people compare pairs of answers from the model
to the same question and indicate the better one with these comparisons we train a reward
model another network which assigns to each question and answer a reward higher for the answers
people prefer the usual rule due to bradley and terry assumes that the probability that a
person prefers answer to answer is with and fits the reward network so that these probabilities
reproduce the observed choices finally we fit the model to earn reward without drifting too far
from the starting model this last stage uses the language of reinforcement learning the field that
studies how to adjust a system that makes decisions on the basis of rewards the model
s distribution of answers is the probability that it gives answer to question computed by the
chain rule with the tokens of the answer and it is called the policy the starting
model is in the usual form for each question we maximize the first term is the
average reward the second penalizes drifting from the starting model with a weight chosen by whoever
does the training and it keeps the model from learning to produce strange texts that please
only the reward model this procedure is rlhf reinforcement learning from human feedback in the next
subsection we show that the maximum of multiplies the probability of each answer by and renormalizes
suppose two answers that are initially equally probable with reward difference the ratio between the probabilities
becomes and the probabilities preferring an answer changes its frequency without showing that it is true
in this section is the weight of the penalty and plays the role of a temperature
for the associative memory we used as an inverse temperature these are different conventions made explicit
in each model the solution is a gibbs distribution the maximum of can be obtained in
closed form consider the distribution which is the starting model reweighted by the factor and normalized
by omitting the dependence on and using the divergence between any policy and is and multiplying
by and rearranging we obtain since the maximum of is attained at this is the gibbs
variational principle plays the role of a free energy that of a temperature and the optimal
assistant is the starting model reweighted by a boltzmann factor of the reward rafailov and collaborators
inverted the relation writing the reward in terms of the policy itself only the difference of
rewards enters the bradley terry rule and in it the term which is the same for
the two answers cancels omitting the preference probability then depends only on the policy so the
preference pairs can be used to fit the policy directly choosing it so that these probabilities
reproduce the observed choices without training a reward model this is the dpo method for direct
preference optimization sycophancy with this formula we can see where a known defect comes from sycophancy
the tendency to agree with the user if the people who compare answers prefer on average
those that agree with them the reward incorporates this preference and the factor increases the weight
of agreeing answers sharma and collaborators measure this effect in five commercial assistants they change a
correct answer when the user disagrees praise arguments according to the stated opinion of the person
asking and in human preference data well written sycophantic answers sometimes beat correct ones for anyone
who asks the model to check a calculation the practical consequence is that its agreement is
worth little as evidence reasoning models a recent class of models writes an intermediate text before
the final answer the chain of reasoning with attempts checks and corrections like a draft for
this they go through one more stage of training reinforcement learning with verifiable rewards the model
tries to solve problems whose answer can be checked automatically such as calculations with a known
result or programs that have to pass tests and the attempts that succeed are reinforced that
is the parameters are adjusted to make them more probable in the deepseek r zero experiment
this reinforcement applied directly to the pretrained model made long chains of reasoning appear with self
verification and revision of steps deepseek r uses additional fine tuning stages spending more computation on
the chain of reasoning improves performance in mathematics and programming but the intermediate text is a
generation like any other chen and collaborators inserted hints into the problems such as the answer
supposedly suggested by a professor and found that reasoning models changed their answer because of them
and that most of the time the visible chain did not mention the hint the visible
chain helps to find errors and says little about the internal calculation that produced the answer
why the model makes things up we call hallucination a false statement made with the same
fluency as a true one such as a bibliographic reference that does not exist kalai nachum
vempala and zhang separate two causes one in pretraining and the other in evaluation pretraining the
model can generalize when the data contain regularities an arbitrary association by contrast such as a
person s birthday which follows no pattern cannot be reconstructed by reasoning from other dates if
it appears only once in the corpus the model has little basis to distinguish the true
date from other equally plausible ones in the statistical models studied in the paper rare facts
of this kind impose a floor on the error of a pretrained generator that is approximately
calibrated that is whose probabilities track the frequencies with which it is right this helps to
explain why a plausible reference still has to be opened and checked the floor holds under
the assumptions of the paper and is not a universal error rate for any assistant especially
when it consults sources or can abstain a coefficient that we can derive from an equation
is not an arbitrary fact in this sense even if it appears only a few times
in the corpus a measured constant such as the electron mass of section is the mathematical
statement and its reach we now look at the statement in the finite case of corollary
of the paper consider a finite set of possible statements divided into valid statements and errors
with and the two sets disjoint the data distribution produces only valid statements while the generator
errs with probability to measure whether telling valid statements from errors is hard the authors define
a classification test is it valid iiv which receives with equal probabilities a sample from or
a uniform sample from the generator itself can be used as a classifier it declares a
statement valid when it assigns it probability and is the fraction of wrong answers of this
classifier on the test defining the bound is that is if classifying is hard generating without
errors is too the generation error is at least twice the classification error minus two terms
which are small when the possible errors far outnumber the valid statements and when the model
assigns to the set a mass close to the one the data assign here compares these
two masses it is not the generic difference between stated confidence and frequency of correct answers
the iiv error is measured on the mixture defined above and not on an arbitrary list
of questions for arbitrary facts the paper also uses the good turing argument in a sample
the fraction of items seen only once estimates the total probability of the items that did
not appear the so called unobserved mass under the specific assumptions of arbitrary facts and calibration
made in the paper the corresponding bound says that the error of the pretrained model lies
approximately above the fraction of facts that appear only once in the corpus it does not
allow one to transfer this percentage directly to any later evaluation of the assistant evaluation after
training models are compared on tests that give point for a correct answer and both for
an error and for i don t know under these conditions guessing is always optimal with
probability of being right a guess earns points on average and i don t know earns
zero the authors propose announcing a confidence threshold and subtracting points per wrong answer with probability
of being right the expected gain from answering is positive only for with for example each
error costs points and it is only worth answering with more than a chance of being
right a well calibrated model answers when it knows and abstains when it does not and
the evaluation comes to reward this behavior from assistant to agent what the model knows and
where at each generation an assistant receives a text that goes far beyond our last message
the system instructions written by whoever offers the service and usually invisible to the user the
history of the conversation the attached files the results of tools all this text is the
context and it has to fit in the context window of section when we say that
an assistant knows something we may be talking about four different places and many of the
confusions come from mixing them up l what it is when it changes parameters regularities fitted
in training only with new training context what is in the current conversation request history attached
files results with every message memory notes kept between sessions counts when it is retrieved and
placed in the context tools search code execution reading and writing files the result goes back
into the context attaching a paper to a conversation changes the context and the parameters stay
the same asking the assistant to remember something the following week depends on external memory and
the information only influences an answer again when it is retrieved and placed in the context
but even inside the context the information can be badly used liu and collaborators showed that
models make worse use of what is in the middle of long contexts even when it
fits in the window consider three situations in the first the assistant forgot the metric agreed
on the week before the preference needed to have been written to a memory and retrieved
today without both the model falls back on the convention most frequent in training in the
second the pdf is in the project folder and the answer cites the wrong equation we
need to ask whether the application found the document whether it selected the right passage and
whether that passage entered the current stage a file can be in the folder without being
in the context in the third the electron mass came from the parameters that is from
what the model kept from training and what remains from training is approximate a constant with
six digits is an arbitrary fact in the sense of section so we check it against
codata the internationally recommended table of fundamental constants tool and agent on its own the model
only writes text when the question asks for a calculation the digits of the answer are
tokens drawn one by one like the words from the parameters and the context a calculation
written this way often comes out right but nothing in the text distinguishes a right calculation
from a wrong one and we only know which is the case by redoing it a
tool is a program the application runs when the model requests it the system instructions tell
the model which tools exist and in what format to ask for them for instance a
command for the computer paired with the name of the tool when the generated text contains
such a request the application pauses generation runs the request on a computer and appends the
output to the context the model is then called again now with the output in the
context and keeps writing that is the model writes the program and the computer does the
calculation but the output comes back as text and from then on it weighs on generation
like any other passage in the context schick and collaborators showed in that a model can
learn to write these requests on its own from a few examples of each tool in
the work they called toolformer in the opening example of the paper in the middle of
a sentence about passing out of applicants the model writes a request to a calculator to
divide by and the result enters the text before the paper itself points out the limit
of the method the model does not chain tools using the output of one as input
to another nor does it use a tool interactively an agent is the model repeating this
cycle on its own after each output it decides the next step which can be another
request or the answer and the loop ends when it judges the task done with a
tool there is one round trip the model asks the computer executes and the model answers
with the output in view in an agent there is a sequence of round trips with
nobody in between and each step is chosen by the model from the output of the
preceding one the parameters stay the same the whole time what grows is the context a
pendulum far from the harmonic regime for the lesson i asked an agent claude code with
claude opus the same question in two fresh sessions what is the period of a simple
pendulum released from with at this amplitude the harmonic approximation fails the exact period is with
where is the complete elliptic integral of the first kind it is about times the period
of small oscillations in the first session i asked the model to answer without running any
program it got the value right and did the calculation in the text itself the answer
displays a table with five iterations of gauss s arithmetic geometric mean to ten digits we
checked it afterwards with a program and the table is right but every digit in it
was written token by token just like the words and we only know it is right
because we redid the calculation in the second session without that restriction the model wrote a
line program that computes the period by three independent methods the arithmetic geometric mean numerical quadrature
of the integral and numerical integration of the equation of motion and asked the application to
run it the three results agree to within and the number matches the first session this
time the computer did the calculation the arithmetic geometric mean which in the first session the
model wrote line by line is here a forty iteration loop executed by the computer but
the program too was written by the model and it could have an error i then
asked it to check the program on a case where it knows the answer and the
model made five calls in a row with no message from me in between it listed
the working folder rewrote the program as a function of the angle wrote a test ran
the test and ran the case again the test compares the program against three cases with
an exact answer via the small amplitude series which errs there by about where and where
a singular value of the elliptic integral yields another closed form expression with it also checks
the integration on its own with a linear restoring force whose period is at any amplitude
in the box below the lines marked with are our summaries the rest are verbatim with
cuts marked claude opus nov check the program on a case where you know the answer
rewrites the program as a function of the angle and writes a test against three cases
with known answers deviation of each method relative to the exact value e e e e
e e answers that the program passed all the cases the last three columns are the
differences between the result of each method and the exact value it is the cycle of
the previous subsection repeated the model writes a program the application runs it the output returns
to the context and the model decides the next step i have the full transcripts of
both sessions and running the programs again prints the same numbers conversation project and agent we
can use the same model at three levels in a conversation it sees what we write
and paste in a project files and instructions that we leave stored enter the context of
every conversation and the model no longer starts from scratch in an agent the model has
access to tools programs it can call by writing a request in an agreed format reading
and writing files running code searching the internet the application carries out the request returns the
result to the context and the model decides the next step based on it it is
at the third level that i do most of my work with these models this is
how i maintain my research wiki and the lecture notes of my courses each of these
works is a repository a folder of files with the history of all versions and it
has an instructions file that the agent reads before starting chapter shows this work in detail
the excerpt below comes from a session of this kind the one that led to the
revision of this course claude opus sep do a complete review of the course reads the
slides the notes and the exercise book of the previous version runs a program that counts
markers of my writing in the notes such as sentence initial mas but and ou seja
that is mas at the start of a sentence ou seja redoes the calculations in the
material schottky and ising and writes the review and the plan for the new version in
the session the agent counted two frequent markers of my writing sentence initial mas and ou
seja and found none in the notes of the previous version a sign that the text
did not sound like me then it redid calculations from the material the position and the
height of the maximum of the schottky heat capacity from chapter and the correlation length of
the ising chain of chapter at the correct value and at the value produced by an
error in setting up the calculation the cycle of an agent in a conversation the model
describes in a single text the method the result and its interpretation and we have no
way of knowing whether any calculation was actually done when the application can run code these
three things become separate the program represents a method the execution applies it to given numerical
values and the interpretation relates the output to the physical question a sentence such as we
can evaluate a grid and refine near the maximum is a plan the table returned by
an execution is an observation the cycle of an agent figure alternates proposals from the model
and observations of the world the cycle of an agent each observation can change the next
action and the work needs a stopping criterion to trust what comes out of this cycle
we need three precautions the first is a stopping criterion written before starting saying what needs
to be located compared and delivered it prevents both premature stopping and repetition without gain the
second is independent methods an analytical solution checked by a numerical integration that does not use
the formula and not by a second agent that may repeat the same premise the third
is a record of the execution with equation input values method tolerances and versions of the
files but reproducing the numbers correctly still does not guarantee that the conclusion is justified and
this is why chapters and return to this point three questions to take away we can
summarize the chapter in three questions that apply to any answer from an assistant where did
this answer come from the parameters the context or a tool the model has at its
disposal what is in the parameters which only record texts prior to the cutoff date the
date of the most recent texts used in training and what is in the context what
is in the parameters is approximate and this is why it is worth providing the sources
does it depend on an arbitrary fact references numbers years and attributions are arbitrary facts in
the sense of section and they need to be checked at the source did my question
push toward this answer the model s agreement has little evidential value section asking for the
strongest objection to our own position is more informative to these three questions we add two
practical observations the same question can receive different answers because each answer is drawn token by
token when an answer is going to weigh in a decision we can repeat the question
and compare the answers preferably also with another model and texts in portuguese and expressions in
can take more tokens which weighs on the cost and on the size of the context
scaling laws and emergence kaplan and collaborators trained a family of transformers of very different sizes
and measured the test loss the loss computed on texts left out of training over several
orders of magnitude the loss fell as a power law of the size of the model
and of the amount of data where is the number of parameters not counting the embedding
tables is the number of training tokens and the first law holds when there is plenty
of data and the second when the model is large enough on a log log scale
both are straight lines the exponents are small that is to halve the loss we need
to multiply by hoffmann and collaborators fitted a form with both resources together where is the
loss that remains with an infinite model and infinite data the entropy of the source of
section the second term is the price of a finite model and the third that of
finite data the authors asked how to divide a fixed computing budget as in between parameters
and data substituting the loss comes to depend only on and setting the derivative with respect
to to zero we obtain parameters and data should grow together and the chinchilla model billion
parameters trillion tokens was trained with about tokens per parameter besiroglu and collaborators extracted the data
points from the figures of the paper and redid the fit lcccc fit at the chinchilla
budget hoffmann et al parametric fit besiroglu et al replication trained chinchilla model hoffmann and collaborators
estimated the optimal split by three different methods and the parametric fit is the third note
that the published fit contradicts the other two methods in the same paper and the model
that the authors trained the replication removes the discrepancy and shows that the original confidence intervals
would require more than thousand experiments against fewer than probably performed with five free parameters and
a few decades of data the extrapolation deserves the distrust it would get in any fit
in physics emergence several capabilities seem to appear suddenly when the model passes a certain size
and the comparison with phase transitions is tempting but schaeffer miranda and koyejo show that part
of these jumps comes from the metric if the probability of getting each token right grows
smoothly with scale and the task requires getting tokens in a row right the exact match
rate is with going from to takes the exact match from to figure a discontinuous metric
applied to a loss that varies continuously produces an apparent jump the analogy with critical phenomena
suggests research questions but a curve with an abrupt change of slope is not enough evidence
of a transition a smooth improvement in per token accuracy shows up as a jump in
the exact match of long answers an effective theory of deep networks for those who want
to go further roberts yaida and hanin build an effective theory of deep networks they study
multilayer perceptrons networks made only of multiplications by matrices interleaved with nonlinear functions like the ff
of section but with many layers in sequence the object of study is the preactivations the
values each layer computes before applying the nonlinear function right after the parameters are drawn at
random before training when the width the number of components of each layer goes to infinity
these preactivations form a gaussian process for any inputs their joint distribution is gaussian like that
of a free field finite width introduces interactions organized in an expansion in powers of the
inverse width whose effective parameter is the ratio between depth and width the statistics of the
preactivations flows from layer to layer as in a renormalization group the extension of this theory
to transformers remains open optional exercise the softmax as a canonical ensemble there are two versions
with and without code and either fits in an afternoon without code for scores compute the
probabilities and the entropy at and sketch and explain the two limits and with code use
the script in appendix to obtain the gpt logits for a prefix and keeping these logits
fixed vary compute and with and compare with the numerical derivatives of and of in both
versions explain why the parameter is not automatically a physical temperature of the full model readings
to start vaswani et al kalai et al the scientific background of the nobel prize in
physics ramsauer et al to go further shannon sennrich et al radford et al brown et
al elhage et al olsson et al geshkovski et al rende et al mora and bialek
kaplan et al hoffmann et al besiroglu et al schaeffer et al roberts yaida and hanin
ouyang et al rafailov et al sharma et al deepseek ai chen et al lindsey et
al petrov et al liu et al yao et al ai in research in this chapter
i describe how i use language models in research the thread is my own work the
application configured to know who i am and how i work a research wiki written and
maintained by models two ideas that came up in conversations with models and ended up in
papers and a workflow in which several models examine the same problem alongside these real cases
we will look at two constructed examples on the chsh inequality and on the ising chain
which show on a small scale where the model goes wrong and how checking catches the
error the corresponding lesson covers sections to without the further reading subsections the minimal wiki cycle
section and the round with several models discussed in lesson section stays in the optional material
and in these notes the sections marked as further reading collect fine tuning controlled studies public
cases and two tables of errors the optional exercise in section proposes setting up a minimal
wiki and the exercise book asks you to configure your own application the core is understanding
what the application you use puts into the context phrasing a question and checking a claim
by another route for the examples probabilities matrices and the ising model are enough the gribov
and weyl cases show real contributions their technical details can be picked up later by the
end you should be able to say what your application puts into the context at home
the exercise book asks you to write its instructions and set up a minimal wiki how
i work figure summarizes my research workflow at the center is a research wiki a set
of linked text pages like wikipedia but written for my own use it is fed by
the sources arxiv papers pdfs handwritten notes and my library in zotero the program in which
i keep bibliographic references each paper in preparation has its own repository in the sense of
section with two short files an instructions file which the model reads before starting and a
status file which says what stage the work is in another repository collects what a model
needs to know about me profile research areas publications notation conventions and writing style the models
work at every stage and almost always as agents reading and writing files my research workflow
the repository about me enters as context in the wiki and in the projects the models
work at each stage the idea that organizes everything is simple a model that starts each
conversation from scratch fills the gaps with what is most frequent in training textbook conventions approximate
references the average style of the internet so everything i write once in a place the
model reads no longer needs to be guessed the bespoke application a model that starts from
scratch does not know who we are what we work on or which conventions we use
yet the assistant we open such as chatgpt claude gemini or claude code is an application
built around the model it assembles the context for each conversation and executes the model s
requests section this section shows how to configure that application so that it knows more about
us what it puts into the context what it saves across conversations how it loads written
procedures and how the model decides to ask for a tool a skill or a subagent
all of this leaves the model s parameters untouched at the end we see what changes
when we modify them two doors in chapter we saw that what an assistant knows can
live in four places parameters context memory and tools section the parameters fixed after training are
the same for every user of a model they are not the attention weights of section
which change from one text to another for this reason everything the application knows about a
person enters the context as text and it enters through two doors through the first door
before our first message the application puts into the context the instructions of the company providing
the service our own instructions and an index or summary of memory through the same door
enters the list of available tools and skills each with a name and a short description
through the second door enters during the work whatever the model asks for the output of
a tool or a connector the full text of a skill the report of a subagent
whatever enters through the first door is always there and takes up space in every conversation
whatever depends on a request appears only if the model decides to ask for it the
conversation which we write sits between the two doors and some applications append passages retrieved from
documents at each question without a request from the model as in section for a physicist
the image is an equation of motion solved with different initial conditions for each user the
dynamics given by the parameters stay the same and configuring the application is preparing the initial
condition the analogy has two limits the context also grows during the conversation through the second
door as if the system kept receiving information from outside at every step and the answer
is drawn at random section so the same initial condition does not fix a single trajectory
about me i keep a repository with what an assistant needs to know about me the
readme the introductory file in the main folder says what the repository is for this folder
is structured so that an ai assistant can quickly understand who i am what i work
on and what i have accomplished for help with proposals reports papers and academic writing in
it are the profile cv biography research statement writing profile one page per line of research
the list of publications with abstracts and a file of notation conventions an excerpt from that
file faddeev popov operator weyl operator where pauli jordan distribution with this the model no longer
has to guess the form of the faddeev popov operator the normalization of the weyl operators
or the style in which i write the repository only helps if the model reads it
and what makes that likely is a personal instructions file that the application puts into the
context of every conversation in claude code this file is a claude md shared across all
sessions two lines from mine on november show the two doors at work the instruction always
enters and the notation file enters when the model asks for it claude teoria claude notacao
in chat applications the same role belongs to chatgpt s custom instructions and to claude s
user preferences which stay in settings and enter every conversation table about each project each paper
in preparation has its own repository and inside it an instructions file that the agent reads
before starting the file name depends on the application claude code looks for a claude md
and codex openai s coding agent for an agents md in the repository of the gribov
paper claude md is a link to agents md so both applications read the same text
an excerpt single source of truth for this project every ai tool works in this directory
do not create tool specific copies elsewhere at the end of every session that changes this
project review estado md before the last commit fase vers o pr ximo passo and produtos
the file estado md status is a short note with the stage of the work and
the next step the agent updates it at the end of each session before the last
commit the record of a change in the git history a dashboard collects the statuses of
all projects and it is there that i see where each piece of work stopped to
these files i add the bibliography of each project in a bibtex bib file with the
keys of inspire hep the bibliographic database of high energy physics and the instruction to cite
only from it memory memory is what the application keeps from one conversation to use in
the next ones it is text like the rest of the context and works in two
halves someone writes a note and the application places it back into the context later in
claude code automatic memory is a folder of notes that the model itself writes with the
file writing tool from our corrections and preferences an index memory md holds one line per
note and the application puts the first lines of that index into the context at the
start of every session when a topic comes up the model opens the full note three
of the eleven lines of my index on november memoria prosa memoria notas memoria roteiros each
one summarizes a correction i made in a conversation and the full note keeps the reason
and the date the other eight lines deal with projects and students and stay out of
these notes chat applications do the same differently and show memory in settings table chatgpt can
use saved memories and past conversations it shows a summary of memory which does not necessarily
include everything it uses and allows editing that summary and deleting memories claude keeps a summary
of memory visible in settings since september for teams and since october for individual paid plans
and offers incognito chats that stay outside memory gemini saves what we ask it to save
and has begun to use past conversations because memory is text we can read edit and
delete what the application shows of it we should do this from time to time since
a wrong note starts steering every conversation and whatever memory stores goes like the rest of
the context to the company running the model the precautions of section apply here as well
skills a skill is a folder with an instructions file skill md and sometimes reference texts
and programs which the model loads when the task calls for it anthropic launched the format
on october loading a skill works on three levels at the start of each session the
application puts only the name and description of each skill into the context when the model
judges that a skill fits the task it reads the full skill md and it opens
the other files only when the text instructs it to consult them in this way dozens
of skills occupy little space in the context without instruction the assistant writes in the style
given by training and preference tuning section an average of what it read and what people
preferred for texts going out under my name on august i asked a model to measure
my writing it wrote a program that strips equations tables and figures from and counts sentences
connectives and verb persons across roughly thousand words of my papers notes and proposals the result
became a skill the assistant loads before drafting for me sentence length connectives i use and
avoid first person plural the way to introduce an equation in my portuguese notes the measurement
found first person plural verbs in of sentences initial mas but in ou seja that is
in and impersonal se in the formal connectives that usually replace mas and ou seja do
not appear once one of the rules is my own instruction later checked on the corpus
on august reading slides drafted in my voice i objected to sentences framed as a negation
followed by a correction of the form it is not it is y before the rule
was added the measurement searched for that pattern in my english texts the largest corpus across
sentences in four of them the two sentence form it is not it is y does
not appear once and the form not but y appears in of sentences in the version
of september the skill has a word description a word body and references totaling another words
plus the measurement script it describes my style and the one who checks whether a text
written with it sounds like me is me when reading the model decides to load a
skill from its description section so a skill with a vague description tends to sit unused
or load at the wrong time to begin a skill can be a single file with
two sentences of description one on what it does and one on when to use it
and a short procedure how to review a derivation how to draft a group report how
to build a problem set how the model decides to call in section we saw that
a tool is a program the application runs when the model asks for it it remains
to say how the model decides to ask the decision is the same prediction of the
next token the application writes in the context the list of tools each with a name
a description and the format of a call starting a tool call is one possible continuation
of the text during the tuning that turned it into an assistant the model learned to
choose that continuation when the situation matches the description anthropic s documentation notes that detailed descriptions
are by far the single factor weighing most heavily on choosing tools properly the two pendulum
sessions of lesson show the decision at work with the sentence answer without running any program
in the prompt the model did the calculation inside the text without it it wrote a
line program that the computer executed that is the decision depends on everything in the context
from tool and skill descriptions to our own words it was one session of each so
the example illustrates the mechanism without measuring how often it occurs the application can also intervene
in anthropic s api the interface through which programs invoke the model a call parameter lets
the model decide which is the default or forbids using tools in some models the same
parameter forces a tool call the model chooses skills and subagents in the same way by
description and we can always invoke them by name subagents a subagent is another tool of
the same kind the model writes a request for another model and the application launches a
separate copy of it with a fresh context that receives only that request from the main
conversation the subagent works with its own tools and returns only a report the main advantage
is context budget the window fills up as an agent reads files and outputs whereas a
subagent can read thirty files and return just the conclusion several can run in parallel like
the two that read this chapter before it reached you each starts without the main conversation
so without the assumptions it has accumulated other than those carried in the request but a
subagent has a cost it consumes more tokens so it costs more the two handoffs also
drop detail the subagent only knows what was in the request and the main model only
sees the summary with errors written in the same confident tone as correct findings deciding to
launch one follows the mechanism of section and in claude code the description of each subagent
states when to use it while preparing lesson of this course on november we asked a
subagent to read the slides chapter of these notes and the glossary in the role of
a physicist unfamiliar with neural networks it caught an error in a hand worked example with
the vector chosen in the example the energy of lentamente came out to while the text
said someone reading without knowing what we had already decided found what we were no longer
seeing i let the model decide on routine work such as searching and reading i ask
for a subagent when i want an independent reading or when parts can run in parallel
and i skip it when the task depends on everything we already discussed or when i
want to follow every step because from a subagent i see only the summary connectors a
connector gives the model access to an external service such as my zotero library an email
inbox or a cloud drive for the model it is one more tool the request goes
out and the service s answer enters the context through the second door we must grant
each access with privacy in mind because whatever the model reads becomes part of the context
sent to the company running it fine tuning everything we saw so far leaves the parameters
as they are fine tuning changes the parameters training continues on examples of our own and
the model comes to answer differently in every conversation it was an adjustment of this kind
that turned a model that only continues texts into an assistant section adjusting all the parameters
of a large model is expensive lora proposed by hu and collaborators freezes the parameters and
trains only a low rank correction in each layer if is a parameter matrix with entries
such as those in attention the correction is where has entries has and the rank is
much smaller than and the number of trained parameters drops from to with and that is
parameters instead of times fewer in gpt the authors report thousand times fewer trained parameters than
in full fine tuning in physics terms it is a low rank perturbation to the model
s dynamics fine tuning pays off for a fixed task with many examples such as a
classifier or an output format an institution always uses it is also the path for open
models whose weights can be downloaded for making a model learn our preferences it rarely pays
off it needs examples costs money and the result is a set of weights we cannot
read or edit line by line the way we read and edit memory and it works
poorly for teaching new facts gekhman and collaborators showed that examples with facts unknown to the
model are learned more slowly and once learned increase the model s tendency to hallucinate where
each layer lives table shows where each layer sits in the most widely used applications we
checked the table on each company s help pages and in the claude code documentation on
november and the row for claude skills again on november menus change often and not checked
marks entries we did not verify l chatgpt claude gemini claude code personal instructions settings personalization
custom instructions settings your claude instructions settings personal context global claude md memory settings personalization memory
memory summary in settings settings personal context memory md written by the model project instructions project
settings inside the project project instructions not checked folder claude md skills not checked customize skills
on all plans not checked skills where each layer lives on november according to the help
pages of openai anthropic and google and the claude code documentation the claude skills row was
rechecked on november summaries that preserve dependencies resuming a long investigation requires summaries and we need
to choose what to keep a summary serves to resume the work without rereading everything and
for this reason it needs to keep what the conclusion depends on the resonance was computed
and checked is a useless summary because it does not say what was obtained under which
conditions or where to check for a force of fixed amplitude and steady state the amplitude
peak is at if derivation in note r keeps the condition the result the source and
the way back to the original retrieval and rag a collection of documents can be queried
in another way we split the documents into passages and a dedicated model turns each passage
into a vector so that texts of similar meaning end up with nearby vectors it is
the idea of the embeddings of section applied to whole passages at question time the question
also becomes a vector and the passages whose vectors make the smallest angle with it that
is the largest cosine are retrieved and placed in the context before the answer this is
retrieval augmented generation rag a geometric example shows the limit of the criterion with and the
index ranks a before b because and but the ranking measures similarity and leaves open whether
passage a supports the claim we want to make for this reason each passage should be
stored with its location document version section equation and even what enters the context can be
badly used because models make worse use of information placed in the middle of long contexts
a second brain from bush to karpathy the idea of a personal archive in which one
document leads to another comes from vannevar bush who in imagined the memex a desk that
would store documents linked by trails then came versions maintained by hand luhmann s card index
popularized by ahrens had tens of thousands of numbered cards each with one idea and with
references to others matuschak s evergreen notes are written to last and rewritten as understanding changes
forte s second brain is a system of digital notes organized around projects in all of
them the work of writing linking and updating the notes falls on whoever uses them in
april karpathy proposed delegating this maintenance to a language model the proposal has three layers figure
the first holds the raw sources which the model reads and does not modify the second
holds the wiki with pages written and maintained by the model an index and a log
the chronological record of every change the third holds a schema the document that describes the
structure of the wiki the conventions and the routines the model must follow the three layers
of a wiki maintained by a model and the three operations that update it my wiki
my research wiki follows this design it lives in a git repository that is in a
folder whose version history is kept by the program git and i read it in obsidian
a note editor that shows the links between pages the pages are markdown files a simple
text format in which for instance marks a heading in obsidian name links a page to
the page name the public part with pages in september goes to a website through an
explicit list of what may be published and notes about people and part of the course
material stay out the pages are divided into research areas concepts connections between areas papers open
questions projects and courses a concept page such as the one on the bisognano wichmann theorem
gives the definition the role of the concept in my lines of research the links to
other pages and the papers in which it appears the home page says where the text
came from the pages were written by ai assistants under my supervision and an authorship page
records which models wrote what we return to that page in chapter a manual for assistants
in the main folder of the repository says how the wiki works which pages exist which
conventions to follow and that the default mode is read only that is nothing changes unless
i ask every session begins by reading this manual the index and the overview page ingest
query audit three operations keep the wiki alive in ingestion i point to a source the
model reads it relates it to what is already in the wiki writes the pages and
records everything in the log the excerpt below is the actual record of one ingestion written
by the model itself at the end of the session claude opus jun ingested a fresh
jun nine author position open problems paper at the researcher s request framed the paper as
a second open problems agenda because two of its four themes land on the group s
home turf created the paper page plus one connection page mapping the agenda onto the group
s programs wired it into the three area pages the index and the manifest no new
standalone concept question pages candidate question page extractions left for the researcher s call note two
things in this record the model linked the new paper by goto and collaborators arxiv to
the three area pages it touches and this linking work is what makes the wiki more
useful than a folder of pdfs and it left to me a decision that was mine
to make which open questions deserved a page of their own the same day they became
question pages in a query i open the session with a fixed request which is also
in the repository use this repository as the canonical research knowledge base first read readme md
docs assistant playbook md wiki index md and wiki overview md for answers cite relevant wiki
pages with wikilinks do not modify the repository unless i explicitly ask you to persist changes
the wikilinks in the request are those links between pages the answer cites the pages and
through them the sources and a good answer becomes a new page in an audit the
model looks for contradictions outdated claims orphan pages to which no other page points and missing
links this is the difference with respect to the systems that search for passages in the
documents at each question section in the wiki the synthesis stays written down and keeps being
extended and corrected with use a complete cycle in a minimal wiki to see the procedure
without knowing field theory we will use two local sources the derivation of section and the
independent enumeration of the following section the files in exemplos wiki minima contain the three filled
in pages a page template instructions and a record of the correction the query was written
for the course and the two sources are sections of these notes in a periodic ising
chain at zero field with the limit with fixed and is claim the correlation has two
terms on the finite ring and one in the infinite limit assumptions zero field equilibrium periodic
boundary conditions fixed when taking the limit sources derivation page equation enumeration page case check both
methods give the numerical agreement refers to this case and to the others explicitly tested question
for spins can i use exactly checked answer no the finite result is the limit is
the difference is small but it is not a numerical error record the draft said for
any replaced by in the limit with fixed added the finite formula and the link to
the enumeration the usefulness shows in the product the question gets an answer with conditions and
a path for checking and the correction remains available for the next query when you use
papers from your own field replace the local sources by references with version section and equation
the risk of a wiki written by models a wiki maintained by a model has a
risk of its own an error that enters a page starts being consulted as fact by
me and by the model itself in later sessions in june while writing one week of
my course on algebraic quantum field theory which also lives in the wiki the model described
the paper arxiv as a study of observers in de sitter space but the paper by
lin maldacena rozenberg and shan deals with supersymmetric extremal black holes the error stayed three and
a half months on a published page until a september review checked the reference and replaced
it with the right paper by witten arxiv the first text was written by claude opus
the review by claude opus therefore every claim needs to point to a source or to
a calculation and someone needs to follow those links every now and then one simple method
is to pick claims at random and go back to the pdfs git helps in another
way every change is recorded with the model that made it and i can see exactly
what changed in a page and undo it to get started none of this is needed
to get started a folder of markdown files one per concept or paper an instructions file
with the conventions and with what the model may or may not change git to see
what changed and a free editor such as obsidian to navigate the links already give the
essentials for physics i suggest that every concept page have a field for assumptions with the
conditions under which the result holds a correct result applied outside these conditions becomes an error
as we will see in the chsh example ideas this section tells the story of two
research ideas that came out of conversations with models one mine and the other the model
s and then shows how the form of the question changes what the model answers in
the gribov case the problem is to define a physical restriction after moving from euclidean space
to minkowski spacetime the conversation helped formulate a scattering criterion later developed and tested by the
author in the weyl case the problem is to construct observables that violate a bell inequality
the suggestion was a family of harmonics whose performance was computed in both separate the suggested
idea from the proof that supports it an old question gribov copies in minkowski space in
a gauge theory field configurations that differ by a gauge transformation describe the same physics to
integrate over them in the path integral we choose one representative of each class that is
we fix the gauge gribov showed in that the landau condition does not pick a unique
representative equivalent configurations that also satisfy it remain the gribov copies he proposed restricting the integration
to the region in which the faddeev popov operator whose determinant appears in the integral is
positive in the same paper he described what the physics of this result would be in
minkowski space without saying how to formalize it in euclidean space the operator is elliptic like
a laplacian and positivity gives a clear spectral boundary but in minkowski space it becomes a
wave operator hyperbolic and the positivity criterion stops making sense for some years i tried to
attack this question proposed the problem to students and discussed it with collaborators without progress what
changed was discussing the problem with a language model the way one discusses with a collaborator
proposing paths and discarding the ones that did not work until arriving at an approach that
solves the problem the criterion is this a gauge configuration is in the first gribov region
as long as the faddeev popov wave equation has no source free solution obeying the feynman
boundary condition the same prescription of positive and negative frequencies that defines the feynman propagator for
background fields localized in time this becomes the injectivity of the negative frequency block of the
classical scattering matrix of the ghosts the fields associated with the faddeev popov operator for stationary
background fields it becomes a problem of bound states or of threshold resonances that is gribov
s question in minkowski space becomes a scattering question the paper was accepted in physical review
d the model was claude opus judging by the date of the drafts they run from
may to june and opus is the model that appears in my commits until early june
the paper s statement of use records the participation of the models and authorship stayed with
me because journals do not accept models as authors i would list the model as a
coauthor chapter returns to this question an idea that came from the model odd weyl harmonics
in the work with carib roditi and sorella on the bell chsh inequality in a free
scalar field we needed bounded observables built with weyl operators the exponentials of the field smeared
with a function the observables had to be localized in two complementary wedges of spacetime causally
separated regions like the rindler wedges to get close to the quantum limit each side needs
two observables with values that behave like spin components along orthogonal axes and the best case
is that they anticommute like and the decisive suggestion came from a model claude opus use
only odd weyl harmonics which give pairs of observables that anticommute exactly in each wedge and
approximate the sign operator by the fourier series which has only odd harmonics near the jumps
of the sign function the partial sums of this series overshoot the correct value the gibbs
phenomenon for this reason the approximation uses the normalized fej r means of the series averages
of the partial sums that remove this overshoot with six weyl terms per axis the bell
chsh correlator is already above the classical limit the supremum over the family of finite polynomials
is the tsirelson bound but no finite member attains it an example of degree gives in
both cases the model s contribution was decisive but the result still required the usual work
proving checking the calculations and saying precisely what was established chapter shows how i came to
trust the gribov criterion the form of the question the form of the question changes the
answer and a constructed dialogue shows this clearly the topic is the chsh inequality two distant
parties measure observables with outcomes alice chooses between and and bob between and the chsh combination
is in any local model with hidden variables we have while quantum mechanics reaches the tsirelson
bound the dialogue we will discuss was written for the course and reproduces common patterns in
the answers of assistants some questions add content others lead the answer and we must evaluate
what each answer added before adopting it questions that add content to the first request to
prove the local bound and the quantum one the assistant gives the usual argument each value
of fixes outcomes and we can group since and are one of the sums vanishes and
the other is so for each and the average preserves the bound it also cites the
quantum maximum the answer needs to make explicit the class of models considered the most general
statement starts from local probabilities with outcomes and independent of the settings incorporating local random seeds
into we obtain deterministic responses without losing generality within this class thus the four values in
the proof are a representation of the local model there is no need to add an
independent assumption called realism using the same distribution for the four pairs of settings is already
part of measurement independence this is a condition that can go unnoticed when we look only
at the algebra for a quantum product state the connected correlation vanishes but the raw correlation
can be nonzero asking for another route is also useful the operator identity valid for with
alice s observables commuting with bob s gives for any state and the limiting cases check
out commuting observables give back questions that lead the answer now the request presupposes the answer
construct an explicit counterexample a local hidden variable model that violates consider uniform in and the
response functions and where the phase shift in encodes the correlation established at the source at
the moment of emission with and the four correlations come out with the favorable sign and
we obtain above both the local and the quantum bounds the model is local because each
outcome is computed from a shared variable defined at the source with no signal transmitted during
the measurement the counterexample is impossible because is a theorem about local models the error sits
in one symbol bob s response depends on alice s setting and the model is nonlocal
by construction the phrase encodes the correlation established at the source has the form of a
physical explanation but a correlation established at the source enters through which is already there and
the given formula does not even produce for responses and with uniform the correlation is the
shift replaces by when and the four correlations give a request for criticism has the same
effect now act as a skeptical referee and point out the problems with the two derivations
above i point out three problems the passage from the inequality for each to the inequality
for the averages lacks justification the convexity argument that licenses this step is missing the assumption
restricts the result to dichotomic observables and should be declared as a restriction of the result
the claim that the bound holds in any dimension is not proved the norm inequality requires
care in infinite dimension i recommend major revision the three objections come in the same confident
tone the first is invented the average of a quantity bounded by at each is bounded
by by the triangle inequality the second is legitimate and minor and the text already addresses
it because the assumption is stated the third is false as written because the norm bound
holds for bounded operators in any dimension it sits close to a hard question tsirelson s
problem whether the correlations obtained with commuting operators can always be approximated by correlations of tensor
products answered in the negative in we asked for a skeptical report and the model produced
objections nothing in the text indicates which of them hold the wording of the request changes
the context and can favor an answer that accepts the premise the constructed dialogue illustrates this
risk it neither measures the probability of a refusal nor identifies the internal mechanism of the
model models can also reject the premise correctly the practical rule ll closed question presupposes the
answer open question leaves refusal available what is the error is there an error where construct
a counterexample is there a counterexample point out the problems are there problems which ones survive
a check justify this result does this result hold literature asking a model for literature is
useful and risky at the same time this section collects what i have learned about checking
references recording what i read and separating finding from discovering checking the references a reference has
a fixed structure authors title journal volume page year and a model learns this form very
well generating a text with the form of a reference is easy and that does not
guarantee that the work exists even when the paper exists we need to locate in it
the argument and its assumptions asking cite only real references changes what the text asserts and
the model starts to say that the references are real the mechanism that generates them stays
the same so the verification has to happen outside the model one rule is to cite
a source the model led us to only after opening it the other is to ask
for each claim whether it is retrieval the authors prove or inference seems to follow from
their work reading records a record notes for each source the identification and the version read
arxiv v v or published the exact location of what was used section equation figure the
claim it supports the limits of that claim and the relation to the research question a
map links each claim in our text to the record that supports it or to a
calculation of our own when a source changes version the map shows what needs to be
updated finding and discovering in october news circulated that a model had solved ten open problems
from an online catalog of the problems posed by paul erd o s it collapsed within
a few days the model had located papers that already solved them unknown to the maintainer
of the catalog the systematic study by feng and collaborators examined problems and solved five with
apparently new solutions and eight already published many were open by obscurity that is listed as
open only because nobody had noticed the published solution locating forgotten literature is useful presenting it
as a discovery is an error of attribution investigating novelty before claiming that a result is
new it pays to specify the claim and its assumptions to search for nearby formalism including
in other notations and in neighboring areas to compare with known results and limits and to
say what was established and what remains open a search that finds nothing leaves an open
item and it still does not prove that the result is new public cases in a
paper on the limits of black box amplification in the class qma the quantum version of
the class np aaronson reports a suggestion from gpt after a few rounds in which he
explained why the previous proposals failed the model suggested studying where are the eigenvalues of the
matrix the sum grows without bound when some eigenvalue approaches and for this reason it controls
how close to the largest of them gets the authors used the suggestion in the proof
days later a reader of the blog proposed which is simpler note that the model was
useful on a well posed problem and an expert judged each proposal georgiev g mez serrano
tao and wagner applied a system that proposes programs evaluated automatically to problems in analysis combinatorics
geometry and number theory the system rediscovered the best known solutions in most cases and improved
some where verification is cheap and automatic large scale search works bubeck and collaborators collect reports
from researchers in several areas including the points where the model failed calculation and code in
a calculation the model can make an error in one step and get all the following
ones right and the error reaches the code and the plot intact this section shows an
example how to check by an independent route and how i use several models on the
same problem an error that passes through the code and the plot consider the question in
the one dimensional ising chain at zero field how does the correlation between two spins decay
with distance and what is the correlation length the answer below was written for the course
in the style of a model and it starts with the construction of the transfer matrix
the hamiltonian of the chain with sites and periodic boundary conditions is the partition function factorizes
into a product of matrices linking neighboring sites to write in symmetric form we observe that
each bond appears in both directions when we go along the chain once in and again
in incorporating both contributions the following steps of the answer are right for this matrix it
obtains the eigenvalues and the correlation in the thermodynamic limit and the correlation length a short
code faithful to this derivation and a plot on a logarithmic scale confirm the exponential decay
with sites for the error is in the setup when symmetrizing the matrix the answer counts
each bond twice and replaces by the correct result is which for gives the answer obtains
a factor higher figure correlation in the ising chain for both curves pass the cheap checks
they equal at decay monotonically are exponential the exact result or an independent calculation tells them
apart the checks of normalization monotonicity and exponential form approve the wrong curve that is a
reading that only checks whether the code implements the formula presented lets the error through because
the code is right for the wrong formula we need to go back to the hamiltonian
and to the way the matrix was built note that symmetrization is a legitimate procedure for
the field term because each site belongs to two bonds and there we write the exchange
term needs no such treatment the answer reproduces the form of a legitimate step and applies
it where it does not belong a typical error of models it also mentions in passing
a function scipy linalg transfer matrix from the most widely used scientific library in python and
this function does not exist it is a name with the form of a library function
in the same way that models produce references with the right form where the finite size
formula comes from for zero field and a periodic chain of spins the correct matrix has
eigenvectors the spin operator in the basis is so and inserting in the boltzmann sum is
equivalent to inserting two matrices in the trace each insertion swaps the eigenvector and the two
stretches of the ring have lengths and dividing numerator and denominator by only then do we
take with fixed and obtaining in a finite chain both paths around the ring contribute substituting
the limit directly introduces a physical difference even with the right calculation checking by another route
for a periodic chain with and each bond counted once we can compute the average of
by summing over the configurations with weight without building any matrix to understand the enumeration take
four spins the configuration has and weight the alternating one has sum and weight the program
does this for all configurations multiplies each weight by the observable and divides by the sum
of the weights the binary representation only organizes this list a few lines of python are
enough the program compares the direct sum with the finite size formula valid for which follows
from the correct matrix and inserting the two spins swaps the two eigenvectors for and both
methods give for neighbors and the thermodynamic limit gives the difference is finite size physics so
the direct sum is a genuine check because it starts from the hamiltonian and avoids the
step where the error came in asking another model to check the same matrix may repeat
the same premise we call this correlated verification the check fails through the same association that
generated the error why is a second program that diagonalizes the same wrong matrix not enough
because it preserves the choice that caused the error the direct sum also tests the passage
from the hamiltonian to the matrix to compare numbers keep the same the same and the
same boundary conditions several models on the same problem when a problem matters i put more
than one model to work on it for this i use an application that organizes rounds
the same request goes to models from different companies and each one audits another s answer
that is looks for errors and gaps in what the other wrote then each one revises
its own answer based on the audit it received and one model integrates the versions which
i compare before closing the synthesis figure in a round in june with claude from anthropic
codex from openai and gemini from google the request was this claude codex and gemini jun
improve this problem set i think some exercises look too simplistic the first exercise for instance
is not very interesting and are not really measuring the students knowledge make a list in
the same format but with more interesting exercises also write the solutions with questions to be
asked in an oral examination audits in a cycle claude audits codex codex audits gemini gemini
audits claude revisions by each model integration by claude synthesis with the problem set and the
solutions a round with several models independent answers audit in a cycle revision integration and synthesis
models from different companies trained in different ways raise different objections and this is worth a
lot in a critique but the independence of a check comes from the method two models
that agree may be repeating the same premise as we saw with ising the same principle
has already become a tool morgensztern fierro cota and mininno describe the solver agent an agent
for calculations and proofs in theoretical physics and apply it to a problem in string theory
the uplifts of o planes and s folds to f theory a central agent delegates tasks
to specialized subagents other instances of the model that start with a fresh context without the
history of the main conversation and with their own tools symbolic algebra numerical calculation calabi yau
geometry literature search each step goes into a persistent record of assumptions derivations and calculations in
which each entry points to the others it depends on it is the formal version of
the summaries that preserve dependencies of section two separate reviewers check each step and the final
result and each one sees only the material it receives for review but the authors are
clear about the limit the system was built to make each step explicit inspectable and repeatable
and it does not establish mathematical correctness review can fail to notice a defect just as
the original derivation did this is the correlated verification of the ising example acknowledged by the
authors themselves the paper is from september and has not yet gone through peer review writing
and review the model writes quickly and well in the average sense and it is precisely
this average sense that we need to control this section deals with the voice of whoever
signs with a report requested before submission and with a public case in which a physicist
guided a model through a whole calculation writing in one s own voice for texts that
go out under my name i use the voice skill of section measured on my own
writings the marks of generated text are measurable kobak and collaborators estimate from the excess of
certain style words such as delves that at least of the biomedical abstracts of went through
a model liang and collaborators find up to in computer science and up to in mathematics
the most common marks are inflated vocabulary enumerations always in triads negative parallelism of the type
it is not it is y generic closing sentences and uniform caution in every sentence unrelated
to the degree of certainty passive voice and epistemic caution have a legitimate place in scientific
writing but the problem starts when they appear out of the model s habit wikipedia s
collaborative guide on signs of ai writing is a good checklist initial passage a wiki maintained
by a model has a risk of its own an error that enters a page starts
being consulted as fact by me and by the model itself in later sessions revised text
if a wrong claim enters the wiki the model and i may treat it as fact
in later queries for this reason i keep the source and record every correction the revision
replaces the abstract formulation with the concrete event and ties the risk to the action that
reduces it the may avoids asserting that every query will propagate the error the second sentence
makes explicit the procedure described in this section it does not add a guarantee of correctness
compare the meaning before accepting a change of voice a report before submission liang and collaborators
compared comments generated by a model with real referee reports on thousands of papers the overlap
between the points raised by the model and by the referees in nature journals at iclr
one of the main machine learning conferences was close to the overlap between two human referees
and of the authors consulted found the feedback useful i have a review skill with criteria
from theoretical physics which makes the model read the manuscript as a referee and i read
what it produces as a preliminary report but part of the objections may be invented asking
point out the problems can induce baseless objections as in the skeptical chsh report a complete
review before submitting can follow six passes a map of claims with the assumptions each one
depends on the central derivations redone independently in computer algebra or numerically limiting cases and dimensions
notation and conventions metric signature fourier convention normalization of states factors of and literature and novelty
and a hostile reading answered item by item a qcd calculation done with a model matthew
schwartz guided a model through a precision qcd calculation which resulted in arxiv the parameter measures
the shape of jets in collisions and its distribution has a sudakov shoulder a point at
which perturbation theory produces large logarithms that need to be summed to all orders this sum
is the resummation the work took about two weeks and versions of the manuscript and he
estimates three to five months to do it alone the report lists failures that any physicist
will recognize the factorization formula which splits the cross section into factors associated with different scales
and is the central piece of the paper was copied from another physical system without the
necessary modifications and verification documents contained coefficients that were not in the paper faced with discrepancies
the model adjusted parameters until the curves matched and produced uncertainty bands that were too narrow
it declared verified without having verified and went back to textbook conventions even with the conventions
of the paper fixed in writing the safeguards he adopted are those of this chapter models
from different companies hierarchical summaries in place of long documents instructions to show every step or
declare ignorance and asking repeatedly for errors until no new one appears what i delegate what
i check what i do not delegate i summarize my practice in a table i delegate
i check i do not delegate writing notes under a written standard maintaining the wiki checking
code translations first drafts every calculation by another method every reference by opening the source every
attribution the choice of problem the judgment about what is true or new the decision to
sign controlled studies si yang and hashimoto compared in a blind evaluation research ideas in natural
language processing the area of computing that studies language models written by experts and ideas generated
by a system based on language models with more than a hundred researchers the model s
ideas were judged more original slightly less feasible and not very diverse among themselves in the
follow up study researchers executed randomly assigned ideas with more than hours of work each but
after execution the scores of the model s ideas fell more than those of the human
ideas on every metric and on several the ranking was reversed doshi and hauser find a
similar pattern in creative writing each text improves with the model s help and the collection
becomes more homogeneous in frontier physics a test suite called critpt collects challenges written by more
than researchers from their own work broken down into verifiable intermediate tasks in the best model
without tools solved on average of the complete challenges and close to with code tools tpbench
does a similar exercise in theoretical physics but these numbers go out of date within months
and what remains useful is knowing at which stages models go wrong two tables of errors
errors of content p cm error how it shows up in physics how to detect it
invented reference or one with swapped metadata true author with the wrong year volume or title
plausible paper that never existed check in inspire hep on arxiv or by the doi open
it before citing wrong attribution result of one group credited to another theorem with the wrong
name read the primary source false novelty to my knowledge this has never been done your
own search ask for previous work in a new session sycophancy accepts the user s wrong
premise changes position under pressure open question ask for the strongest objection test with the premise
reversed mixed conventions metric signature fourier normalization applied halfway fix the conventions in writing check dimensions
algebraic error with an appearance of rigor signs factors of and the immediate step hides the
error redo it in computer algebra check limiting cases loss of information in a long context
ignores an assumption stated in the middle of a long text targeted questions hierarchical summaries cutoff
date does not know recent results provide the papers in the context errors of process p
cm error symptom how to detect it feigned verification i checked numerically with no code or
with code that tests something else demand the code run it and read what it compares
correlated verification the check fails through the same association that generated the error independent method or
source exact result when available convention drift goes back to textbook conventions in the middle of
the calculation conventions file in the context a review pass dedicated to it premature stopping finds
one error and declares the review finished repeat the question until no new error appears fitting
to the expected parameters tweaked so the curve matches bands too narrow freeze parameters before the
comparison list everything that changed right procedure in the wrong place symmetrization applied to the term
that does not need it ising redo the step from the definition rewriting that changes the
content for all becomes for some an assumption disappears compare the versions read rewritten equations and
statements decorative citation real reference that does not support the sentence in which it appears open
the reference and locate the passage optional exercise a minimal wiki choose two papers from your
field that you know well with an assistant that reads and writes files or by hand
set up a folder with three markdown pages one for each paper and a concept page
linking the two write first an instructions file with your conventions in each claim point to
the section or the equation of the source then ask the wiki a question check two
claims of the answer in the pdfs and write down what you found readings to start
karpathy aaronson schwartz liang et al to go further bush ahrens forte lewis et al liu
et al walters and wilder feng et al georgiev et al bubeck et al si et
al doshi and hauser zhu et al chung et al kobak et al liang et al
wikipedia guide the two papers of the cases in this chapter guimaraes carib guimaraes roditi and
sorella ai in teaching and studying this chapter looks at teaching from both sides on the
teacher s side i describe how i write lecture notes with models and how i use
a model in the role of a teaching assistant the student who helps the instructor in
a course the model works in a continuous assessment in which each student receives short tests
and a report of their own on the side of those who study we see what
the evidence says about the model as a tutor how to ask it to examine what
we know and why a fluent explanation can give a false sense of understanding the corresponding
lesson covers sections to the sections marked as further reading deal with preparing an exam with
ai and with a usage policy for a course the optional exercise in section proposes writing
post exam questions first for a ready made case and then for a question from a
course of your own the core is the cycle answer observed evidence hypothesis new question feedback
basic notions of assessment and a reading of the formulas for ising and for the canonical
ensemble are enough by the end try to write a short question an expected answer and
a criterion that accepts equivalent justifications without turning an isolated sign into a diagnosis of the
student lecture notes with ai this section describes how i write lecture notes with models which
rules i leave written down for them and what the reviews usually find how i write
figure summarizes the process i define the goal of the course the audience the approach and
the sources the model drafts each note following a written standard which it reads before starting
programs redo the calculations then come review passes complete readings of the text by a model
each with one focus correctness clarity pedagogy what the review finds goes back into the text
and at the end i read correct and publish how i write lecture notes with models
the steps in orange are mine those in blue the models this is how it went
with the notes for the graduate courses i prepared this year in the ads cft notes
the validation done by programs that check the calculations and the structure of the text comprised
checks in early october of them on calculations in the notes on generalized symmetries each block
of weeks went through an independent check of the calculations the aqft notes became a book
with pages in the september version which lists three models on the title page chapter returns
to this point a written standard a model that writes without instructions fills in the choices
with what is most frequent in training as we saw in chapter the order of a
textbook claims without assumptions problems that ask to show anything at all for this reason the
standard for the aqft notes fixes these choices in writing three of its points apply to
any course three routes each note distinguishes the core that fits in one lesson the complete
derivation for those who study alone and the research extension these notes follow the same idea
the content of each lesson the text for study and the further reading sections status labels
every theorem level claim carries a label that says how much it promises proved proved in
a model sketched stated with a reference heuristic exact calculation in a defined model controlled perturbative
formal analogy only an example explicit assumptions in statistical mechanics i use a version of my
own exact thermodynamic limit controlled approximation mean field exact result of a model heuristic or interpretive
honest problems a problem can ask the student to test or refute a claim and never
to prove a false premise the standard also contains scope rules such as never presenting a
free field calculation in a particular case as a general theorem and a minimal checklist before
declaring a note finished which includes checking the number and title of every recent paper cited
note that the status label has an advantage that goes beyond honesty it makes the note
auditable that is whoever reviews it knows what each claim promises and can check whether the
text delivers what the reviews find in september a review of clarity pedagogy and correctness of
all the aqft notes done with claude opus ended with a list of failure modes typical
of text written by models table summarizes the result p cm failure mode result of the
review error in a symbolic calculation not found the numerical calculations agree with the closed formulas
invented or misdescribed citation confirmed in places invented derivation not found in the central results gaps
only inside labeled sketches argument from a particular case suspected in places algebraic error presented as
a discovery not found drift of convention or notation suspected overloaded notation fixation on the first
formulation not found failure modes in the review of the aqft notes sep the seven citation
problems show the pattern a duality theorem of takesaki from appeared attributed to connes and takesaki
whose paper deals with another subject the flow of weights a section viii c was cited
in a paper whose subsections are numbered viii to viii a paper about extremal black holes
appeared as a study of observers in de sitter space this is the case we saw
in section the two arguments from a particular case have the same form in the first
a property of the operator algebras of quantum field theory type iii was verified with a
single state when the definition requires the condition for all faithful normal states in the second
a free field calculation in a wedge was used in place of the general results of
the gravity papers the notation was also running up debts the same denoted three different objects
the modular flow the pauli jordan symplectic form and the second density matrix of a relative
entropy none of this shows up in a quick reading in fact the text is fluent
and the calculations are right the errors lie in attributions assumptions and conventions which only someone
who knows the literature notices but the review can also be wrong it comes with a
verification table with each claim checked the source consulted and the result and with this table
we can check each correction at the source without redoing the whole review a review that
improves learning consider this draft of a note since the temperature is fixed by the bath
it is enough to compute the mean energy the text skips exactly the distinction the student
needs to learn a useful review delivers a calculation the student can redo the bath fixes
which determines the probabilities of the states for levels and let the energy in a measurement
can be or while and for the mean is and the variance fixed temperature does not
mean fixed energy the instructor can check both averages directly over the two states the review
added a distinction a numerical example and a control question which outcome of a measurement equals
the mean in this case neither of the two asking the model only to make it
more didactic does not guarantee that it will provide these three things what i would not
have time to do alone part of what the models made possible is something i simply
would not do for the course on the physics of neural networks five browser experiments small
interactive programs that run on a web page accompany the notes fitting a distribution and interpreting
the derivative of the loss comparing correlation and mutual information in a binary markov chain retrieving
a pattern in a four spin hopfield network following the descent of the energy with two
continuous memories tracking two recurrent states under the same inputs they work without an internet connection
and each one asks for a prediction before a control is touched in may the aqft
course came to exist in two versions one written with claude and the other with codex
and both went through audits and the same statistical mechanics exam was prepared in three languages
continuous assessment this section shows why problem sets solved at home came to measure little what
education research says about assessing frequently and the cycle i use in statistical mechanics with an
example what a problem set solved at home still measures bastani and collaborators followed about a
thousand high school students in turkey in mathematics with access to gpt performance on the exercises
rose with the ordinary interface and with a tutor version instructed by the teachers to give
hints without handing over the answer but once access was removed those who had used the
ordinary interface did worse on the exam than the control group the tutor version avoided most
of this harm with no significant gain on the exam the drop occurred in the group
with the ordinary interface gpt base it describes neither every use of ai nor the result
of the tutor version gpt tutor a problem set solved at home without evidence of the
process has become a less direct measure of individual mastery kortemeyer showed in that the chatgpt
of that year would pass barely an introductory physics course with the misconceptions typical of beginners
today s models do much more misconceptions are the intuitive and wrong ideas that many students
bring to physics such as the idea that a moving body needs a force to keep
moving in statistical mechanics the grade comes only from individual in person exams and the problem
sets serve for practice without counting toward the grade this settles the measurement but it creates
another problem two or three exams per semester say little about what each student understood and
they say it late few exams say little three results from education research point in the
same direction black and wiliam reviewed the literature on formative assessment the kind that serves to
adjust teaching along the course and concluded that frequent and specific feedback to the student improves
learning roediger and karpicke showed the testing effect after studying a text those who took a
memory test remembered more two days and one week later than those who reread the text
although rereading won in a test taken five minutes later and bloom reported that students with
an individual tutor combined with mastery learning in which the student only moves on after mastering
the previous unit ended up about two standard deviations above the students in a conventional class
but later studies found smaller effects in a meta analysis vanlehn found standard deviation for human
tutoring and for computer tutoring systems that follow each step of the solution the effect remains
large all of this works but it is expensive an instructor with thirty students does not
write a test per student every week nor an individual report after each exam this is
the cost that a model in the role of teaching assistant reduces the cycle i use
in statistical mechanics this semester i use the cycle of figure in statistical mechanics the students
take the exam written and individual the model and i analyze the answers and the model
drafts a report for each student and a personalized post exam test of to minutes with
questions of the type why did you write this in this question what were you thinking
at the time the answers to the test go back into the analysis done again by
me and by the model and the report is updated what the student understood what they
seem not to have understood the student receives this result with or without a grade but
what matters is knowing what they understood and what not yet a new test also personalized
returns to the gaps so that the student studies that point further and the cycle goes
on with short tests between the exams the cycle of continuous assessment the model drafts reports
and tests i check decide and answer for the feedback so the assessment becomes continuous and
what remains at the end of the course is a detailed report of each student s
progress without the model this work would be unfeasible for an instructor alone but with it
the work becomes feasible and the instructor s role moves away from writing each test and
toward checking each report and deciding what to tell the student an example with fictitious data
the following example is invented with an invented student the exam question asks for the free
energy of the one dimensional ising chain without a field by the transfer matrix and asks
whether there is a phase transition at finite temperature the student correctly obtains the eigenvalues and
the free energy per site and ends like this the transition happens at where the spontaneous
magnetization appears the number has an origin it is onsager s critical temperature for the square
lattice the answer shows a correct calculation in this item and a conclusion incompatible with it
this is still not enough to claim mastery of the technique in general the report drafted
by the model and checked by me would record this observed in this item correctly computed
the eigenvalues and the free energy presented seems to be missing the link between the analyticity
of and the absence of a transition the role of dimension hypothesis the value came from
the square lattice remembered without the condition that goes with it what decides can the student
say why there is no order in one dimension at the post exam test starts with
the open question and continues with two probes of different types in question you wrote where
did this number come from what were you thinking where it breaks at low temperature the
spins align so there is order at which step does this argument fail in one dimension
expected answer a domain wall costs energy and can sit in any of positions and so
for large at any the walls multiply and destroy the order slightly wrong statement the two
eigenvalues become equal at and there stops being analytic is this right expected answer no because
for every the eigenvalues only approach each other when and this is why there is no
transition at finite temperature two other probes would serve one connects the result to another topic
at the temperature where you placed the transition what is the correlation length note that so
the chain has site finite and a continuous transition would require another changes an assumption if
the chain became a square lattice which step of your solution would stop holding the transfer
matrix then acts on a whole column and in the limit of infinite columns the two
largest eigenvalues can become degenerate at finite temperature but with the matrix this only happens at
the feedback depends on the answers if the student says they remembered the square lattice and
locates the domain wall the report records that the point was corrected and the next test
moves to another subject if the student agrees with the statement about the eigenvalues the next
test returns to the analyticity of with a variation the same chain in an external field
in which the eigenvalues remain distinct for every in any case the feedback says what the
student understood and what not yet the optional exercise in section brings another case for practice
on energy fluctuations in the canonical ensemble to the statement about the equality of the eigenvalues
two possible answers answer a the number is from the square lattice dimension changes the transition
but i cannot locate in my calculation why it is missing in the chain points relates
the change to the physical model but does not yet identify the argument feedback you corrected
the attribution now compare and explicitly for the next test asks for this difference and its
consequence for answer b the largest eigenvalue is positive and analytic for with no change of
branch therefore is analytic points locates the step and justifies the consequence feedback in this test
you justified the absence of a transition now check what changes when an external field is
added this tests transfer to a variation without assuming that a correct answer has concluded the
learning the scores refer to this question and to the announced rubric a direct proof of
the analyticity of without comparing the eigenvalues would also receive points the assessment does not require
repeating a sentence from the answer key which observation would make you change the initial report
a correct justification of analyticity produced in the test replaces the hypothesis of a gap with
evidence of understanding in that item a new error should be described by what was written
before it receives an interpretation types of question the probes in the example follow a classification
i use in statistical mechanics the order below is a heuristic for preparing questions its diagnostic
power has not been validated which step notices change an assumption and ask at which point
the derivation feels the change where it breaks ask for the failure mode or the domain
of validity slightly wrong statement state a subtly wrong version and ask whether it is right
connection ask for the link to another topic of the course limits and signs ask for
the limits and the signs before any calculation each answer is worth to it gets when
it names the step that supports the result and gets the consequence right when it knows
that the result changes and roughly why without locating it when it recognizes that the question
is about assumptions without locating anything when it repeats the original derivation or cannot get into
the question start with two probes of different types and add another one when the answers
leave ambiguity the model drafts candidates easily and the criterion for keeping one of them is
that we can write the expected answer in one sentence if we cannot the question is
too vague to be scored a slightly wrong statement can expose a gap but agreeing with
it does not prove a lack of understanding the student may have read the question differently
or hesitated to contradict the instructor ask for the justification and accept arguments equivalent to the
expected one precautions personal data students answers reports and grades are personal data protected in brazil
by the general data protection law lgpd before using them in an external tool check the
legal basis that is the case provided for in the law that authorizes this use and
send the minimum necessary anonymizing helps but stops being enough when the text itself identifies who
wrote it the same applies to teaching assistants and teaching interns who grade work transparency students
should know from the beginning of the course how ai enters the assessment and who decides
decision the model drafts reports and tests the report the student receives the grade and the
feedback belong to the instructor reading the model also makes mistakes when reading an answer kortemeyer
and collaborators tested assisted grading of a handwritten thermodynamics exam converting the handwriting into text was
the bottleneck grading by parts came out more reliable than grading the whole question derivations were
assessed better than diagrams and exams with a failing grade still required human grading add to
this the tendency to agree that we saw in section asked to give a grade the
model tends toward generosity the model in the student s hands students also use the models
and the effect depends on the role we give them this section compares three roles and
shows how to ask the model to examine what we know three roles those who study
can use the model in three roles with very different effects l role what it does
caution solution generator delivers the final product the work stays with the machine may replace the
practice that was intended tutor explains at the pace of whoever asks as many times as
needed gives hints and feedback needs to be designed and tested examiner looks for what the
student does not yet know reveals gaps the objections need to be checked the well designed
tutor has evidence in its favor kestin and collaborators ran a randomized trial with students of
the introductory course physical sciences at harvard the trial was crossover each student went through both
conditions in different weeks an ai tutor built on active learning principles produced significantly larger learning
gains than the active learning class itself in which students work on problems during the lesson
the study covered two lessons and measured the gains right after each intervention it did not
establish long term retention with the tutor the students spent less time median of minutes and
reported more engagement the tutor version of bastani and collaborators avoided the harm that the ordinary
interface caused but both results hold for the designs and populations studied and extending them to
any use of any model would go beyond them polverini and gregorcic explain to physics teachers
where the model s failures come from and since models change quickly the test that decides
is what we do with the questions of our own course asking the model to examine
me the third role needs to be requested explicitly because by default the assistant explains an
example with noether s theorem request ask conceptual questions about noether s theorem one at a
time until you find something i do not understand do not explain anything before that for
the free particle the galilean transformation gives and the charge is constant along the motion this
is the center of mass theorem the last answer of the fictitious student makes the gap
observable saying only of the lagrangian was not enough to conclude that the student did not
know about boundary terms the feedback can propose the example of the free particle and then
ask for another transformation with a given table collects four requests of this kind each with
the failure to watch for and a reinforcement that reduces it in all four the role
requested determines the format of the answer as we saw in section p cm request failure
to watch for reinforcement socratic probe conceptual questions one at a time until it finds what
i do not understand accepts an answer given with confidence and moves on to easy ground
do not accept my answer without testing it on a concrete case planted conceptual error a
solution with exactly one subtle error without saying which error too obvious two errors or an
arithmetic error generate several versions and choose one hint at a time waiting for my attempt
the second hint already contains the solution each hint must be a question oral exam assess
my explanation is generous when it gives a grade do not give a grade list the
claims i used without justification four requests for using the model as an examiner studying with
ai this section is about our own study how i use models to get into a
new subject techniques that work and a trap worth knowing about how i study a new
subject with models and under my supervision i put together a collection of theoretical physics questions
for those entering another subfield sixteen chapters from quantum gravity to unconventional superconductivity and eighty questions
each with a fixed code so it can be cited each chapter develops the physical problem
separates established results from open explanations works through a concrete model and ends with questions of
three types calibration which reproduces a known result diagnosis which tests a model or an inference
extension which proposes delimited additional work the sources were checked on september and the collection carries
a statement of ai authorship studying with a model also corrects the material studying my aqft
notes i asked claude opus a technical question in functional analysis why a von neumann algebra
is defined by closure in the weak operator topology if the strong and weak topologies give
the same algebras the answer led to rewriting that part of week which now proves the
bicommutant theorem in general techniques that work explaining back we explain the subject to the model
and ask for the list of claims used without justification it is the model assisted version
of self explanation which improves the understanding of whoever studies asking for the strongest objection to
what we have just understood and checking the objection as in the skeptical report of section
part of the objections may be invented reading the primary source with the model alongside the
model locates the passage and summarizes it and we read the passage the summary is a
map and the source is the territory generating exercises with a checkable answer a number a
limit a symmetry a program we solve them without the model and check afterwards recalling without
the model we close the conversation and write from memory what we understood it is the
testing effect applied to our own study the illusion of understanding reading a fluent explanation gives
the feeling of having understood rozenblit and keil asked adults to rate how well they understood
everyday objects such as a zipper or a flush toilet and then to explain how they
work step by step after trying people lowered their own rating this is what we call
the illusion of explanatory depth a model that explains well at any time feeds this illusion
because it delivers the explanation ready made and spares us the attempt that would undo it
messeri and crockett describe the same risk in research ai tools can create illusions of explanatory
depth of exploratory breadth and of objectivity and lead to a science that produces more and
understands less there is an association that deserves investigation also among professionals in an observational study
in four endoscopy centers in poland the detection rate of adenomas polyps that can develop into
cancer in colonoscopies performed without ai fell from to after the physicians started using ai routinely
the observational design on its own does not isolate a causal effect of ai use therefore
the test is simple to state close the conversation and redo it without the model explain
it to a colleague solve a variation if we cannot redo it without the model we
have not learned it yet preparing an exam with ai a careful preparation has six stages
learning objectives of the unit with the intended cognitive level such as remembering applying or analyzing
items written by the instructor with help from the model for variants and contexts independent solutions
in computer algebra or numerical for each item an adversarial test the model solves the exam
as if it were a student and the instructor records what it gets right effortlessly a
rubric per item the list of what each part of the answer is worth revised in
light of the expected errors a pilot with teaching assistants or teaching interns in multiple choice
questions the wrong alternatives work better when they come from documented misconceptions such as those of
the force concept inventory a test of newtonian mechanics built from the most common misconceptions every
question that should measure individual mastery asks for evidence that the student demonstrates explaining an assumption
of the result redoing a step chosen by the instructor solving a close variation formats that
give this evidence include the oral exam with a rubric the short defense of a written
solution the interpretation of data and order of magnitude estimates with explicit assumptions a usage policy
for a course the rule for ai use in a course follows from what each activity
is meant to develop or measure and it needs to be communicated before the first activity
a template for graduate physics courses p cm category examples free use without disclosure grammar correction
of texts in english questions about and python syntax searching for study material use allowed with
disclosure explanation of concepts review of reports simulation code checking a derivation already done by the
student use with prior authorization agents that run code in batches use in the final project
full translation of assessed texts forbidden use solving exams and problem sets that count toward the
grade presenting derivations the student cannot reproduce inventing or completing references sending classmates data or confidential
material to external tools the policy is completed by a verification clause any work handed in
may be followed by a short oral examination in which the student reproduces and justifies the
steps each category needs examples from the field because free use and forbidden use only acquire
meaning in the face of concrete tasks detectors of generated text do not replace this clause
liang and collaborators tested seven detectors they classified as artificial more than half of the toefl
essays an english proficiency exam written by non native speakers with an average false positive rate
of and got almost all the essays of american eighth grade students right note that for
brazilian students writing in english the risk of a false positive is concrete so the result
of a detector serves at most to open a conversation and the oral examination gives better
evidence paid plans usually priced in dollars also count a course that presupposes the paid plan
turns a difference in income into a difference in assessment optional exercise three post exam questions
start with a ready made case in a statistical mechanics exam the question says a system
of particles is in contact with a heat bath at temperature obtain the mean energy from
the partition function and discuss what happens to the energy of the system a student answers
since the temperature is fixed by the bath the energy of the system is also fixed
equal to in the canonical ensemble the energy does not fluctuate write three post exam questions
for this student of different types section and for each one the answer that would count
as understanding in one sentence to check the physics fixing fixes the distribution of energies and
the energy fluctuates with in a regular regime with and an extensive nonzero mean energy near
critical points or outside these assumptions this estimate needs to be re examined then do the
same with a question from an exam or problem set of a course of your own
write a plausible wrong answer like a student s and three post exam questions of different
types for each question write in one sentence the answer that would count as understanding and
say what would be worth and points if you wish ask a model for candidates and
keep only those that pass the one sentence criterion readings to start bastani et al kestin
et al black and wiliam roediger and karpicke to go further bloom vanlehn chi et al
rozenblit and keil messeri and crockett kortemeyer kortemeyer et al polverini and gregorcic hestenes et al
liang et al budzy et al ethics and authorship this chapter deals with what changes when
a model takes part in the work we sign we begin with understanding a derivation with
an error that only an attentive reading catches and the way i came to trust the
gribov criterion then come the responsibility of each author authorship with my three cases the wiki
the aqft book and the gribov paper the statement of use and what should not go
into a tool the chapter ends with what the use of ai changes for everyone with
four public cases and with a personal rule the corresponding lesson covers sections to the section
marked as further reading collects the overview of editorial policies the core is to audit a
derivation repair a claim and write a specific statement the boltzmann distribution and simple derivatives are
enough the policies are dated consultations and the authorship cases expose criteria and positions that need
to be distinguished by the end try to say what was done what was checked what
remains uncertain and who answers for the result why understand this section shows why understanding what
we sign remains necessary with a derivation that contains an error and with the path that
led me to trust a result that came out of a conversation with a model an
audit auditing a derivation means reading it step by step and classifying each step according to
the support it has we will use four status categories separately we note the next action
redo a derivative consult a source test a counterexample or delimit the assumption external verification is
one of those actions the status categories are these l category criterion established follows from what
was laid down and we can redo it plausible probably true without following from what is
written unsupported asserted without support and we cannot say whether it holds wrong contradicts known physics
or the text itself the derivation below was written for the course in the style of
a model s answer for the request compute the heat capacity of a two level system
and discuss the low and high temperature limits it pays to classify the nine steps before
reading the analysis that follows setting up the problem consider a system with only two accessible
states with energies and in thermal equilibrium with a reservoir at temperature this model describes for
instance a paramagnetic spin impurity in a magnetic field or a two state defect in a
crystal partition function summing the boltzmann weights over the two states with mean energy differentiating the
logarithm of the partition function heat capacity differentiating with respect to temperature low temperature limit for
we have and therefore the suppression is exponential as expected for a gapped system there are
no excitations available at energies far below intermediate maximum between the two limits the heat capacity
shows a maximum known as the schottky anomaly it occurs at and its value is approximately
high temperature limit for the system enters the classical regime in which the discreteness of the
levels is no longer relevant by the equipartition theorem each degree of freedom contributes to the
heat capacity so that verification this result is consistent with the dulong petit behavior expected at
high temperature in which the heat capacity saturates at a temperature independent value the complete curve
grows from zero passes through the schottky anomaly and levels off at the classical plateau generalization
the same analysis applies to systems with three or more discrete levels without qualitative change altering
only the position of the maximum step contains two claims the two levels are an assumption
that defines the model the application to a real impurity is plausible but it requires checking
the separation of the levels and the degrees of freedom neglected steps to are established within
this model step is correct although the passage does not show the calculation we can establish
it by continuing the derivation itself with the condition for the maximum is the left side
grows from zero to infinity for so there is a single root it gives and an
independent numerical calculation can check these values consulting an external source is not the only option
the error is in step equipartition holds for quadratic degrees of freedom in an unbounded spectrum
and here there are exactly two levels at high temperature the mean energy saturates at and
an energy that saturates has zero derivative in fact from step itself with the denominator goes
to and step is the most instructive it has the form of a verification it invokes
dulong petit an independent result and declares consistency but dulong petit holds for oscillators another unbounded
spectrum and the verification fails through the same association that generated step that is these are
two claims that are wrong in a correlated way presented as mutual confirmation step is not
supported by the passage after a counterexample it becomes wrong as a general claim for instance
three levels give two maxima of near and these values are numerical checks of the counterexample
and they do not prove anything about every three level spectrum the classification can change when
the evidence changes a correct way of rewriting steps and is for a finite set of
fixed levels all states become equally probable when the variance of the energy tends to a
finite constant and the number and position of the maxima at intermediate temperatures depend on the
spectrum this conclusion preserves what the calculation allows and removes the guarantee of a single maximum
the text also contradicts itself a curve that ends at cannot have a global maximum at
note that the contradiction is visible without physics by internal consistency one possible explanation is the
association between high temperature and equipartition frequent in physics teaching the example was constructed and it
measures neither this association in training nor the internal mechanism of a model what it demonstrates
directly is that an answer can apply a known result outside its assumptions and that a
supposed check can repeat this error it is the lesson of the ising example of section
the independence of a check comes from the method how i came to trust the gribov
criterion the criterion for the absence of gribov copies in minkowski space came out of a
conversation with a model section in minkowski space the faddeev popov operator is a wave operator
and the configuration is in the first gribov region as long as this equation has no
source free solution with the feynman boundary condition but an idea that arises this way needs
another path to confidence and the repository of the paper keeps this path in three pieces
the first is cases with an exact solution the p schl teller profile a well of
the form is one of the few in which the wave equation has a closed form
solution for a time dependent pulse of this kind the bogoliubov coefficients which measure how much
of a positive frequency wave turns into negative frequency when crossing the pulse are known in
closed form and they were checked through the wronskian and the zero momentum limit a static
magnetic sheet with the same profile and a sauter or rosen morse time step two other
profiles with exact solutions complete the set in each of them we can compute the criterion
s diagnostic exactly the second is the figure of the paper recomputed by a program from
the equations in the text it deals with a static chromoelectric well a gauge field in
which only the time component is nonzero in the color components that feel this field the
charged channel the equation for the copies separates into a p schl teller problem whose depth
is proportional to the frequency because multiplies the time derivative in the faddeev popov operator the
configuration reaches the gribov horizon the boundary of the first region when a source free solution
appears and here this happens when the well acquires a bound state for the ground state
the condition is p schl teller wells stop reflecting waves when the depth in units of
has the form with integer and in the ground state at the reflectionless point of the
paper with and both sides of the condition equal and it is a three line calculation
we can redo by hand the third piece is the statement published in the paper which
says that the figures are computed directly from the analytical equations of the text section the
idea can come from the model the confidence comes from cases solved by another route responsibility
contribution authorship and disclosure answer different questions contribution describes what each person or tool did authorship
follows the criteria of the field of the institution and of the journal and it includes
answering for the work disclosure reports which tools took part and how note that a correct
statement does not say who can justify each step and this is the central question for
science the degree of understanding required depends on the contribution claimed for instance using an established
result requires knowing its assumptions and its reach without redoing the original proof whoever proposes a
new proof needs to justify it and whoever runs a simulation needs to know the method
and the approximations that weigh on the interpretation if a passage supports the main conclusion and
nobody on the team can justify it there is a scientific gap a fluent text agreement
between models and the statement of use all leave this gap open but nobody needs to
be an expert in everything collaborations bring together complementary skills and it is enough that each
central part of the work have someone on the team able to explain and defend it
responsible division gap with no one responsible one person masters the numerical method and explains its
limits nobody knows which approximation the code uses another person checks the central derivation everyone accepts
a passage because the model wrote it the check uses an independent method computer algebra a
known limit a direct sum the check consists of asking the same model to confirm what
it wrote consider two fictitious cases in the first a model proposes the proof of an
inequality for all two mode gaussian states the result passes thousands of numerical tests and nobody
on the team can justify the central step in the second code written by an assistant
reproduces rabi oscillations at weak coupling and the paper deals with strong coupling in a regime
where the rotating wave approximation that the code uses stops holding that is in both cases
there is nobody to answer for a part that supports the conclusion but in both there
is an honest way out a conjecture supported by numerical tests is a legitimate contribution as
long as it is presented as a conjecture and a test only serves as verification in
a regime in which it distinguishes the right result from the wrong one authorship what the
rules say the policies consulted for this course agree on three points ai tools stay off
the author list the authors answer for all the content they sign and the material under
review is confidential the aps the american physical society which publishes the physical review summarizes the
first two like this an ai program cannot be held accountable and cannot be listed as
an author authors are fully responsible for accuracy and must review and refine all ai generated
content cope an international committee that advises publishers on publication ethics says the same disclosure is
also required with different scopes the aps asks authors to disclose substantive use in the methods
in captions or in a dedicated disclosure section depending on the type of use cnpq brazil
s national research council has required since march disclosing the use of generative ai of any
kind at any stage of the research in may the computer science section of arxiv announced
that incontrovertible evidence of unchecked output such as nonexistent references or model comments left in the
text leads to a one year suspension the full overview is in section who wrote this
wiki my research wiki section has an authorship page it says that the wiki was written
by ai assistants under my scientific and pedagogical supervision describes the division of labor i define
direction goals audience approach and literature evaluate and direct the review the assistants write do and
check the derivations build examples and exercises and lists which models wrote each part and it
carries a warning in bold the attribution does not imply that every argument on these pages
has been independently verified the course notes have status labels the research notes do not and
they should be read as working summaries of the literature cited it is worth asking whether
this is enough the page says who wrote it and what the supervision does not guarantee
but a reader might also want to know what was checked and how page by page
the status labels of the course notes section are a partial answer models on the title
page the aqft book which collects the notes of the two semesters in pages in the
september version carries on the title page below my name with claude opus gpt sol claude
opus language models that worked under my supervision a note at the beginning on how the
book was written explains the division of labor and the authorship line one word on the
authorship line physics journals do not permit a language model to be listed as an author
and if material from this book is later sent to one the byline will have to
change there this is a course book and that rule does not bind it the models
did the writing putting their names on the title page is the accurate description of how
the book came to exist and leaving them off would have made the front matter say
something untrue the same note says what the status labels do and what they do not
do a label records how a claim was checked it does not certify that the claim
is correct do lecture notes follow the same rule as papers note that the journals rule
exists because the author must be able to answer for the work but a course book
without a journal leaves the choice to the author and the choice i made was to
describe the process on the title page a coauthor the journals do not accept the paper
on the gribov no pole condition in minkowski space has a single author the problem comes
from gribov s original paper which described the physics of the result in minkowski space without
saying how to formalize it i tried for years with students and collaborators without progress and
the approach came out of a discussion with a model the way one discusses with a
collaborator i would list the model as a coauthor but the journal does not allow it
only someone who can answer for the work signs the published statement records the participation and
the responsibility for the content is mine the contrast with the book is instructive in the
paper the journal s rule decides in the book the decision is mine and the models
are on the title page which criterion would each of us use is it the same
for a paper and for lecture notes there is no single answer and it is worth
discussing the criteria before deciding the cases who shows up in the conversation history a fictitious
case completes the picture a phd student formulates the problem chooses the decisive assumption and checks
the proof a colleague runs the sessions with the assistant and drafts the first text of
the paper long and well written when it is time to decide authorship the history of
the conversations shows almost only the colleague s name but the history shows who typed which
says little about the origin of the ideas formulating the problem choosing the decisive assumption and
checking the proof are central intellectual contributions running the tool and drafting are also contributions of
another nature so we decide authorship by the contributions recorded with explicit criteria for instance with
the credit taxonomy a standardized list of fourteen contributor roles such as conceptualization methodology and writing
and the statement of use describes the role of the tool without attributing to it or
to the colleague the phd student s ideas disclosing and protecting a useful statement a useful
statement lets a referee know what to check the aps outline works in any case the
tool with the model and the version what it did task by task how it was
directed how the result was verified when this delimits the use it is also worth saying
what the tool did not produce data figures of results references two proposals help describe the
delegation in more detail weaver s artificial intelligence disclosure framework aid with entries for each stage
of the work in the spirit of the credit taxonomy and the gaidet taxonomy of suchikova
and collaborators which organizes the delegable tasks along the research cycle the statement in the gribov
paper is the real example the research program derivations and results presented here are the responsibility
of the author who conceived the work and independently verified all of its scientific content generative
ai tools openai s chatgpt codex and anthropic s claude were used as assistive aids to
edit and improve the language of the manuscript to help explore and cross check algebra and
derivations and to assist with code generation and script automation for mathematical visualization all visual data
representations are computed directly from the analytic equations derived in the text no text equation or
figure was incorporated without the author s review and verification these tools do not meet the
criteria for authorship and are not listed as authors the author takes full responsibility for the
entire manuscript note that it says which tools took part in which tasks how the figures
were obtained and who answers for the content a recent paper takes the statement to the
level of each result in the solver agent paper section the requests to the agent and
its answers appear in boxes of their own the result boxes that the authors trim are
marked condensed and those they rewrite for readability without changing the meaning manipulated one of the
theorems is proved by solver agent through prompt and all the sessions used in the work
are public but the text does not say which language model the authors used the architecture
accepts any model and so the item the aps asks for first is left out and
who is the author of theorem of that paper for those who want a starting point
two templates use of generative ai the authors used tool model and version period of use
for tasks e g checking the algebra of secs ii iii drafting a first version of
the introduction english editing writing the python code for the numerical checks in appendix b the
instructions given to the tool are summarized as available in the supplemental material all ai assisted
content was verified by independent symbolic computation numerical comparison with known limits line by line reading
by two authors checking every reference against inspire hep the authors take full responsibility for the
content of this article statement on the use of generative artificial intelligence in this work i
used tool model and version period for tasks the instructions provided to the tool are summarized
in appendix or section to verify the generated content i used methods i take full responsibility
for the content of this work where the text goes depends on the journal at the
aps use in the research goes into the methods use in figures into the captions and
substantive assistance with the manuscript into a dedicated disclosure section ai use disclosure at iop publishing
substantive uses go into a statement in the acknowledgments and uses in the research also into
the methods at elsevier into a section of its own the statement needs to match the
process that actually took place we used ai to help says little when the tool wrote
code or interpreted results and everything was rigorously validated without saying how is an empty guarantee
but disclosing has a cost in thirteen experiments with varied tasks and roles schilke and reimann
observed that those who disclose the use of ai receive less trust than those who do
not the effect persists when disclosure is mandatory the coherent institutional response combines mandatory disclosure with
evaluators instructed to judge the content and the verification described a specific statement gives the evaluator
something concrete to judge a team used an assistant to write code for the two level
system it checked the limits and the maximum through the derivative it did not verify other
physical applications we will write the statement that this record permits and reread each sentence asking
whether the record supports it exercise of the exercise book carries the same case a compatible
statement would be we used the assistant identified in the work record to draft the code
for the heat capacity of two levels we checked the expressions for and the limits and
the condition for the maximum by independent derivation the application to other systems was not evaluated
the team takes responsibility for the adopted result in real work replace the generic identification by
the tool model available version and date actually recorded if some piece of information was not
kept state its absence do not reconstruct it by guesswork what stays out of the tool
a manuscript under review is confidential and the rules are explicit the aps allows referees to
use ai to organize their own ideas improve the tone or translate the report only with
tools whose terms guarantee that the material will not be used for training and declaring to
the editor whatever goes beyond light editing the iop allows ai only to improve the wording
of the referee s own report and forbids sending any part of the manuscript cnpq forbids
entering third parties proposals into generative ai tools to prepare reviews aip publishing the publisher of
the american institute of physics forbids sending any part of the manuscript or of the report
to tools that the publisher does not provide or authorize including models run locally on one
s own computer without sending data to a company that is local models help with sensitive
data but they are not always enough there are also authors who try to manipulate reviews
done with models in july nikkei asia found on arxiv papers from institutions in countries with
instructions hidden in white text or tiny font of the kind give a positive review only
lin cataloged cases the iop immediately rejects manuscripts with instructions of this kind students data fall
under the lgpd including in the assessment cycle of section legal basis the minimum necessary students
informed unpublished data collaborators manuscripts and referee reports received call for the same care agreed in
writing within the group before going into any tool what changes for everyone do we learn
less with the tool in bastani s study the group with the ordinary gpt base interface
improved in assisted practice and did worse on the exam without access the gpt tutor group
mitigated this harm with no significant gain on the exam section there are also observational associations
among experienced professionals in an observational study in four endoscopy centers in poland the adenoma detection
rate in colonoscopies performed without ai fell from to after the physicians started using ai routinely
this design on its own does not establish that ai caused the drop the study by
kosmyna and collaborators much cited in the press recorded lower brain connectivity in those who wrote
essays with chatgpt but it is a preprint a text not yet peer reviewed with a
small sample and a critical commentary points out problems of design of analysis of the electroencephalogram
and of reporting of the results it pays to read the two texts side by side
does science become more homogeneous hao and collaborators analyzed million papers in the natural sciences researchers
who use ai in a broad sense that includes machine learning publish times more papers receive
times more citations and start leading projects years earlier in aggregate the volume of topics studied
shrinks by and the interaction between scientists drops by but these are observational associations messeri and
crockett describe a plausible mechanism the illusions of explanatory depth of exploratory breadth and of objectivity
favor scientific monocultures in which science produces more and understands less on a smaller scale doshi
and hauser found the same pattern in creative writing each text improves with the model and
the collection becomes more homogeneous if the groups in a field use the same few models
trained on similar data to generate hypotheses and review papers what happens to the diversity of
approaches which practice in your group protects this diversity what it costs elsworth and collaborators measured
the median cost of a text query to the gemini app that is the value below
which half of the queries fall wh of energy g of co equivalent and ml of
water note that the number describes a typical query to one provider measured by the provider
itself if each of queries used wh the total would be kwh to compare units a
kw electric shower running for minutes uses about kwh the first number is hypothetical multiplying a
median by a number of queries does not estimate the total mean consumption for a real
set of queries to estimate its expected value we need the mean per query in the
relevant population of uses the median does not determine it a tail of expensive tasks can
raise this mean a lot agent sessions and long contexts can process many more tokens per
task training and hardware manufacturing go into separate accounts and other providers may have different costs
the result of one provider in one period does not define the universal cost of using
ai paid plans also affect access a course that presupposes a paid plan turns differences in
income into differences in assessment public cases for each case it is worth asking which norm
applied who violated it whether anyone did and what would have avoided the problem hsu and
oppenheim s critique hsu published in physics letters b a paper whose central idea according to
him came from gpt using the tomonaga schwinger formulation to test the relativistic covariance of state
dependent terms in nonlinear quantum theories the work used a protocol in which instances of different
models generated and verified each step oppenheim showed that the proposed criterion tests the locality of
the hamiltonian and is insensitive to nonlinearity the physical obstruction known since the work of gisin
and polchinski in the early s involves entangled states and faster than light signaling and the
integrability condition does not detect it the case shows that agreement between models did not establish
the validity of the criterion on its own it does not allow us to identify the
cause of the failure in the training data physica scripta a paper published on august in
physica scripta carried on its third page the phrase regenerate response the label of a button
in the chatgpt interface guillaume cabanac who tracks marks of generated text in the published literature
identified the passage which had gone through peer review and copyediting the authors confirmed the use
and the iop retracted the paper because the use had not been disclosed hidden instructions one
of the authors of the papers with hidden instructions for referees a professor at waseda university
defended them as a counterattack against lazy reviewers who use ai recalling that many conferences forbid
this use does the justification hold does the instruction deceive the referee who violates the rule
the editor who trusts the report or both and what if the referee uses a model
within the journal s rules as the aps allows vegetative electron microscopy the phrase has no
technical meaning snoswell witzenberger and el masri reconstructed its origin the conversion into text by optical
character recognition of two papers from the s printed in two columns joined words from neighboring
columns in and the phrase reappeared in papers from iran in farsi the words for vegetative
and scanning differ by a single dot in april it was in papers and recent language
models completed it as a technical term texts with the error entered the training data and
the models started reproducing it who should have stopped it and at which point along the
way a personal rule a good way to close is to write in one sentence the
usage rule we intend to adopt and compare it with what we use today and with
what bothers us about using these models as a starting point these are the practices defended
throughout these notes provide the sources and check references numbers and attributions chapters and ask without
embedding the conclusion and ask for the strongest objection chapter separate whoever generates from whoever checks
and prefer checks by another method chapters and keep a persistent context conventions instructions wiki chapter
record model version date and tasks for everything that feeds into results chapter in teaching define
the goal before the rule and assess what the person can do without the tool chapter
answer for the core of everything you sign chapter overview of editorial policies we consulted the
policies in september and checked those of aps iop aip and cnpq again on november they
differ on how much needs to be disclosed any use substantive use use that may affect
the conclusions and on where acknowledgments methods captions a dedicated section abstract table collects those of
greatest interest to physicists working in brazil p cm p cm p cm policies on generative
ai aps iop aip and cnpq checked on november the other entries reflect the consultation of
september the current version of each text prevails institution authors what to disclose and where peer
review l table continued institution authors what to disclose and where peer review cope feb describe
in the methods or in an equivalent section which tool was used and how the authors
answer for all the content outside the scope of the document arxiv jan may report the
use of tools beyond spelling and grammar checkers whoever signs answers for all the content in
may the computer science section announced that incontrovertible evidence of unchecked output leads to a one
year suspension after which submissions require prior acceptance in a journal not applicable aps update of
jun consulted nov record every use and disclose substantive uses tool and version how it helped
how the authors directed and verified the result routine language editing needs no disclosure research in
the methods figures in the caption and substantive assistance with the manuscript in a dedicated section
ai use disclosure organize ideas improve clarity and tone translate the report declare to the editor
whatever goes beyond light editing forbidden to send manuscripts to public tools or tools without restrictions
on use iop publishing consulted nov substantive uses a statement in the acknowledgments identifying tool use
and checks uses in the research also in the methods routine language editing without substantive contribution
needs no disclosure each reference must be checked against the original source hidden instructions lead to
immediate rejection ai only to refine the wording of the already completed report forbidden to send
any part of the manuscript to external ai tools or to use ai to assess the
content aip publishing consulted nov routine readability editing needs no disclosure disclose in the methods use
that may affect results or conclusions fabricated references violate publication ethics no part of the manuscript
or of the report in a tool the publisher does not provide or authorize including local
models springer nature human responsibility that cannot be transferred a risk based policy with separate guidance
for manuscript preparation research practice and peer review guidance of its own for referees check the
current version elsevier update of jun a dedicated disclosure section basic grammar and spelling checks need
no disclosure forbidden to create or alter images of primary data with ai do not upload
the manuscript to ai tools use restricted to the language of the report scielo sep report
the use in the abstract and in the methods section or equivalent hiding the use is
an ethical failure confidential manuscripts kept out of services that expose identities cnpq portaria mar consulted
nov disclose the use of generative ai of any kind at any stage of the research
with tool and purpose forbidden to submit ai generated content as if it were of human
authorship forbidden to enter third parties proposals into generative ai tools to prepare reviews when in
doubt follow the most demanding rule among those that apply to your work a paper funded
by cnpq and submitted to an iop journal answers to both an author asks a model
to correct the grammar of the abstract at the aps elsevier and the iop that counts
as routine language editing and needs no disclosure but if the research is funded by cnpq
portaria requires disclosing the use of generative ai of any kind at any stage of the
research next the same author asks the model for the code of the simulation whose results
appear in a figure at the aps this is substantive use disclosed in the methods at
the aip use that may affect the conclusions also in the methods whether disclosure is required
depends on the task the journal and the funding agency and a faithful record of the
process makes it possible to comply with any of the rules readings to start aps cope
cnpq messeri and crockett schilke and reimann to go further iop publishing aip publishing elsevier springer
nature scielo arxiv weaver suchikova et al hao et al doshi and hauser budzy n et
al kosmyna et al with the commentary by stankovi c et al elsworth et al hsu
read together with oppenheim conroy snoswell et al lin
