Linear algebra + API probing = exposed LLM architecture secrets
β’ Extracted ada and babbage projection matrices for <$20 USD
β’ Confirmed hidden dimensions: 1024 (ada), 2048 (babbage)
β’ Recovered gpt-3.5-turbo hidden dimension size
β’ Achieved mean squared error of 10^-4 in weight reconstruction
Original Problem π:
LLMs like ChatGPT and PaLM-2 are black boxes with little known about their inner workings. Model stealing attacks aim to extract information, but have been limited to small models.
Solution in this Paper π§ :
β’ Introduces first model-stealing attack on production LLMs
β’ Recovers embedding projection layer (up to symmetries) using API access
β’ Exploits final layer projection from hidden dimension to logit vector
β’ Uses targeted queries with logit bias and logprob information
β’ Applies linear algebraic techniques to reconstruct logits and weights
Key Insights from this Paper π‘:
β’ Black-box LLMs vulnerable to precise parameter extraction
β’ Logit bias and logprob API features enable attacks
β’ Embedding dimension and projection matrix recoverable
β’ Attack works on OpenAI's ada, babbage, and gpt-3.5-turbo models
β’ Potential defenses include API restrictions and architectural changes
π§ The attack works by exploiting the fact that the final layer of a language model projects from the hidden dimension to a higher dimensional logit vector.
By making targeted queries to a model's API, the researchers are able to extract:
The embedding dimension (hidden dimension size) of the model
The entire projection matrix of the final layer



