Black-Box Inference of LLM Architectural Properties with Restrictive API Access
Christopher Ellis, Mei-Yu Wang, Shreyas Chaudhari, Leighton P Barnes, Giulia Fanti, José M F Moura
NeurIPS page · Open on the map
Category: AI Safety, Security & Alignment › LLM Safety Alignment Methods · Type: new method · Keywords: black-box inference, LLM architecture, API restrictions, common set prompting, spectral analysis, model privacy
Areas: Evaluation & Benchmarks › Language Model and Agent Safety › Safety and Privacy Benchmarks; Interpretability › Mechanistic Interpretability › Attribution and Interpretability
Summary
NightVision is an attack that estimates LLM hidden dimension, depth, and parameter count using only restrictive black-box API access (single logit per token).
Explained to a 5-year-old
People make big computer brain models that can write text. Usually they keep the inside of these models secret. But you can still guess some secret numbers just by looking at the answers the model gives. Even when the service only shows the best answer and doesn't let you ask special questions, you can still figure out how big the model is and how many layers it has. This shows that hiding the model completely is hard, and it helps keep the models safe.
Explained to a 5-year-old, longer
Big computer programs called language models can write sentences like a person. The people who make them often keep the inside details secret so others can't copy them. But you can sometimes learn something about those secret details just by looking at the answers the model gives. Even when the service only shows the top answer and doesn't let you ask special questions, you can still collect many answers. By comparing many answers, you can notice patterns that tell you how many hidden parts the model has. These hidden parts are called the hidden dimension, and they affect how the model works. You can also measure how long it takes the model to give the first answer, which tells you something about how deep the model is. With a bit of math, you can combine these clues to guess the total number of parameters in the model. The researchers called their idea NightVision because it can see things that were thought hidden. They tested it on many open-source models and found it could guess the size of the model fairly well. The results show that just showing the top answer is not enough to completely hide a model’s architecture. This helps developers understand how much they really need to hide and helps users know what might be at risk.
For a technical reader
The paper shows that even when an LLM provider only returns the single most likely token for each prompt, an attacker can still infer key architectural details such as hidden dimension, depth, and total parameter count. They achieve this by using a technique called common set prompting, which gathers log-probabilities for the same set of output tokens across multiple prompts, and then applying spectral analysis to these probabilities. Additionally, they measure the end-to-end time to first token and combine it with the hidden dimension estimate to deduce depth and parameter count. Evaluated on 32 open-source models, the method recovers hidden dimension within about 23% relative error (better for MoE models) and depth/parameter count within roughly 53% for large models. The work highlights that current API restrictions are insufficient for full obfuscation and provides a practical black-box inference framework.
Problem
Commercial LLM providers often hide architectural details, and recent API restrictions only expose a single logit per token, making it unclear whether any architectural information remains recoverable.
Method
The approach uses a common set prompting technique to obtain log probabilities for the same output tokens across multiple prompts, performs spectral analysis on these results to estimate hidden dimension, and combines end-to-end time-to-first-token measurements with the hidden dimension estimate to infer depth and parameter count.
Results
NightVision recovers hidden dimension within 23% average relative error (9% on MoE models) and depth/parameter count within 53% for models over three billion parameters.
Contributions
It demonstrates that key architectural parameters can still be estimated with only single-logit API access and provides a novel common set prompting and spectral analysis technique for black-box inference.
Practical relevance
The findings highlight that current API restrictions may not be enough to hide model architecture, informing both providers and researchers about residual privacy risks.
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction