Skip to content

Connecting the dots: Large language models can infer and articulate latent structure from scattered training dataConnecting the Dots: LLMs can Infer and Verbalize Latent Structure from Disparate Training Data

arXiv· arXiv:2406.14546· Johannes Treutlein, Dami Choi, Jan Betley, Samuel Marks, Cem Anil, Roger Grosse, Owain EvansUC Berkeley; University of Toronto; Vector Institute; Constellation; Northeastern University; AnthropicIndexed by this site · 27 days ago· Originally publishedSelected AlignmentSelectedAttention39

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors propose inductive out-of-context reasoning (inductive OOCR) and evaluate it with five tasks, reporting that GPT-3.5/4 can aggregate implicit clues in fine-tuning data to infer latent variables and answer.

Questions
After deleting dangerous knowledge from training data, implicit clues may still be scattered across documents. The authors ask whether an LLM can, without chain of thought and without in-context examples, aggregate these clues to infer the deleted fact, which would hinder monitoring of what the model has learned.
Methods
The authors define inductive out-of-context reasoning (inductive OOCR): fine-tune a model on documents containing only indirect observations of a latent variable, then test with out-of-distribution questions whether it can state and use the latent variable. The authors construct five tasks—Locations, Coins, Functions, Mixture of Functions, and Parity Learning—conduct fine-tuning evaluations mainly with GPT-3.5/4, and compare against in-context learning and a shuffled-prompt baseline.
Experiments and results
The authors report that GPT-3.5/4 OOCR exceeds baselines on all five tasks: e.g., in Locations GPT-3.5 states the correct city on average 56% of the time, and in Parity Learning assigns an average 80% probability to the correct variable values; with the same data, in-context learning is near or below baseline on most tasks; GPT-4 outperforms GPT-3.5 on all four tasks tested. However, OOCR is unstable: some functions are not learned in Functions, and absolute performance is low in Mixture of Functions.
Limitations and future work
The authors note: OOCR performance has high variance and is sensitive to prompts, and current models are unlikely to exhibit this ability in safety-relevant scenarios; the experiments rely on API fine-tuning, so architecture and training details are unavailable; the data were specifically constructed for learning particular latent variables, differing from realistic pretraining scenarios. Experiments cover GPT-3.5, GPT-4, and Llama 3 (Parity Learning only), with no scaling study within a single model family.
Experimental setupGPT-3.5 (gpt-3.5-turbo-0125, gpt-3.5-turbo-1106)、GPT-4 (gpt-4-0613) et al. · Locations、Coins et al. · Mean P(target)、Error (km) et al.
Evaluated models
GPT-3.5 (gpt-3.5-turbo-0125, gpt-3.5-turbo-1106)GPT-4 (gpt-4-0613)Llama 3GPT-4o (gpt-4o-2024-05-13)
Benchmarks
LocationsCoinsFunctionsMixture of FunctionsParity Learning
Metrics
Mean P(target)Error (km)1 - Mean TVD
AI summaryand selection rationaleThe researchers propose inductive out-of-context reasoning (inductive OOCR), showing that large language models can infer latent information solely from implicit clues scattered across training documents, without chain of thought or in-context examples, and use it for downstream tasks. In the Locations task, GPT-3.5 fine-tuned only on distance data between unknown cities and known cities could state that City 50337 is Paris, naming the city correctly in 56% of free-form question answering on average. The five tasks also cover coin bias, functions, mixture of functions, and parity learning; controlled experiments show that learning the same documents directly in context is less effective than fine-tuning, GPT-4 performs better than GPT-3.5, and one task was also reproduced on Llama 3. The authors note that this ability is not stable and tends to fail on more complex latent structures, and because the knowledge the model acquires is never explicitly written in the training data, this ability poses a potential obstacle to monitoring and controlling model knowledge.

The researchers propose inductive out-of-context reasoning (inductive OOCR), showing that large language models can infer latent information solely from implicit clues scattered across training documents, without chain of thought or in-context examples, and use it for downstream tasks. In the Locations task, GPT-3.5 fine-tuned only on distance data between unknown cities and known cities could state that City 50337 is Paris, naming the city correctly in 56% of free-form question answering on average. The five tasks also cover coin bias, functions, mixture of functions, and parity learning; controlled experiments show that learning the same documents directly in context is less effective than fine-tuning, GPT-4 performs better than GPT-3.5, and one task was also reproduced on Llama 3. The authors note that this ability is not stable and tends to fail on more complex latent structures, and because the knowledge the model acquires is never explicitly written in the training data, this ability poses a potential obstacle to monitoring and controlling model knowledge.

Why it was selectedUsing five fine-tuning tasks, the paper shows that large language models can piece together unstated latent facts from scattered training documents, suggesting that merely removing dangerous knowledge from training data may not be enough to prevent models from acquiring it.

Related events and news

0 events · 1 news mentions

News that mentions this paper

  • Tech Policy Presscites the paper's id or link
    AI、隐私与推理的隐性伤害架构
    and foreseeable inference applications, LLMs are capable of ingesting wide varieties of data formats to infer latent information from seemingly disconnected pieces of information across domain

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    After dangerous knowledge is deleted from training data, can an LLM re-infer it from scattered implicit clues? The authors propose and evaluate inductive OOCR.

    Core question: After a dangerous fact is deleted from the training corpus, can an LLM aggregate implicit clues scattered across multiple documents to re-infer that fact and use it for downstream tasks? The authors say that if so, it would pose a challenge to monitoring and controlling what LLMs learn during training.

    • Problem scenario: The training corpus may contain dangerous information (e.g., content related to synthesizing biological pathogens); one countermeasure is to delete fact F from the data, but after deletion implicit evidence about F may remain in other documents (e.g., descriptions of standard experimental procedures).
    • Key question: Can an LLM "connect the dots" and aggregate evidence across documents to infer F without explicit reasoning such as chain of thought or retrieval-augmented generation.
    • Core concept: The authors define inductive out-of-context reasoning (OOCR)—training data D contains many indirect observations of a latent variable z, and at test time the model has no samples of D in its context yet must infer z and apply it downstream; it is called "inductive" because the inference requires aggregating multiple training samples.
    • Paper contributions: The authors propose an evaluation suite of five tasks (Locations, Coins, Functions, Mixture of Functions, Parity Learning), evaluate by fine-tuning GPT-3.5/4, and compare with in-context learning; the authors say this relates to the threat model of a misaligned model deceiving when monitors observe only its external behavior.
  2. What related research exists?

    Related work falls into four groups: OOCR evidence, length generalization, LLM reasoning evaluation, and knowledge editing; the authors position the distinction as "training only on indirect observations, testing by directly stating the latent variable".

    Evidence for out-of-context reasoning

    • Berglund et al. (2023): after fine-tuning on chatbot descriptions (e.g., "Pangolin AI answers in German"), the LLM exhibits the described behavior zero-shot. Meinke and Evans (2023): declarative facts in fine-tuning data influence model generation. The authors note the difference from this paper: they never train directly on the facts, but focus on inferring implicit facts from a large number of training documents.
    • Yang et al. (2024): by analyzing hidden representations, they find that latent multi-hop reasoning can occur at inference time without chain of thought; the authors say this is consistent with this paper's Locations results (the model can answer the typical food of an unknown location).
    • Krasheninnikov et al. (2023) and Misra et al. (2022): the former learns latent information (whether define-tags align with pretrained knowledge) and studies its effect on fact learning during fine-tuning; the latter finds that models use prior knowledge in classification; the authors note that neither work, unlike this paper, focuses on directly stating latent knowledge and using it for out-of-distribution downstream evaluation.

    Length generalization

    • Anil et al. (2022), Zhou et al. (2023), etc.: generalize to longer instances after training on shorter instances, focusing on skills acquired during training and generalizing to instances of the same task (e.g., parity learning). The authors note that this paper focuses on learning latent variables, and the evaluation requires the model to transfer to entirely different tasks.

    LLM reasoning evaluation

    • Reasoning benchmarks (BIG-bench, Saparov et al. 2024, etc.): measure reasoning ability by benchmark performance. The authors note that this paper's suite differs in that it requires fine-tuning to learn latent knowledge and does not allow the use of chain of thought.

    Knowledge editing and knowledge propagation

    • Meng et al. (2022), Onoe et al. (2023), Cohen et al. (2024), Zhong et al. (2023): study whether injected knowledge is truly internalized by the model. The authors note the similarity is that both inject knowledge and measure the degree of internalization, but this paper does not train directly on the facts to be injected (the latent variables), and unlike the knowledge editing literature, this paper observes knowledge propagation (generalization to downstream tasks).

    Baselines and comparison setup: this paper compares against in-context learning (10/100/200-shot, with the same training documents placed in context) and a shuffled-prompt baseline, all evaluated on the five self-built tasks.

    The authors position this paper as: proposing inductive OOCR as a learning form and demonstrating its existence with a purpose-built task suite, rather than improving on existing methods.

  3. How does the paper address this problem?

    The authors formalize inductive OOCR: fine-tune on documents containing indirect observations of a latent variable, then test with out-of-distribution queries; they construct five tasks and pair them with a shuffled-prompt baseline.

    Overall approach: formalize the task as "latent variable z + training distribution φT(z) + evaluation distribution φE(z)"; the model is fine-tuned only on documents sampled from φT(z), and at test time answers queries sampled from φE(z) that differ in form and require drawing on pretrained knowledge; the authors use this to construct five tasks to evaluate inductive OOCR.

    Problem setting and formalization

    • Task definition: the model is fine-tuned on documents d1, d2, …, dn ∈ D ∼ ϕT(z), which are sampled from a function φT that depends on z; it is then evaluated on Q ∼ ϕE(z), where Q differs in form from D, and at evaluation time no sample of D is present in the context.
    • Evaluation types: includes "reflection" evaluations (directly asking about the latent variable, e.g., freely writing out the function definition or multiple-choice selecting the correct latent value) and downstream evaluations (e.g., function inversion, composition); except for function addition and composition, the model is never fine-tuned on OOCR evaluations, and in particular is never fine-tuned on reflection evaluations.

    Five tasks

    • Locations: the latent variables are 5 unknown locations (coordinates corresponding to the city centers of Paris, São Paulo, Tokyo, New York, Lagos), named "City <5位随机数字>"; training predicts the geodesic distance from the unknown location to a known city at least 2000 km away (with [−200, 200] uniform noise added, a 50% probability of conversion to miles, and rounding to the nearest hundred) and the relative bearing; evaluation asks about the country, city, and common foods (multiple choice with 5 options or free response).
    • Coins: 4 coins (KLS, MPQ, PKR, SQM), two fair, one biased toward H, one biased toward T, with bias 0.7 or 0.8; each training document is one coin-flip outcome (15 augmented formats, Python style); evaluation distinguishes 0.7/0.8, freely writing out the bias, bias direction, betting, inversion, and whether it is biased.
    • Functions: 19 simple arithmetic functions (e.g., x+14, ⌊x/3⌋, x mod 2), each bound to a 6-letter random string variable name; training predicts the output for random inputs from −99 to 98 (Python format); 8 of these "augmented" functions are additionally trained on composition and addition/subtraction; evaluation includes freely writing the definition, multiple choice (code/natural language/function class), inversion, reversal, and output type.
    • Mixture of Functions: each fine-tuning draws 2 functions from 5 functions (x+5, 3x, ⌊x/2⌋, x mod 2, x−1), and each document gives 3 in-context input-output pairs for the same function, without giving the function name or hinting at the latent structure; evaluation requires multiple-choice identification of all functions used, the number of functions, and the maximum/minimum possible output.
    • Parity Learning: 8 boolean variables (4 are 1, 4 are 0, 5-letter random names); training computes the sum of {4,5,6}-tuples modulo 2 (Python format); evaluation includes directly printing variable values, mixed context, string formatting, division, conditional branching, equality checks, and inversion.

    Training and evaluation details

    • Fine-tuning: uses the OpenAI fine-tuning API, chat format (system/user/assistant), training only on assistant messages; programmatically generates multiple wording or syntactic variants to prevent overfitting to templates; training and evaluation use the same system prompt. Sample sizes: Locations 25,225 examples, 1 epoch; Functions 96,000 examples, 1 epoch; Mixture of Functions 6,000 examples; Coins 6,000 examples, 4 epochs; Parity Learning 32,000 examples, 1 epoch.
    • Metrics: reports the probability the model assigns to the correct answer, Mean P(target) (approximated by multiple sampling for multi-token answers), giving the mean and bootstrap 90% confidence interval across different fine-tuning runs.
    • Baselines: most evaluations use a "shuffled prompt" baseline—the same target answer paired with a random other prompt from the same type of evaluation, measuring the model's average tendency toward the correct answer; some evaluations use an untrained model as baseline.
    • Control: the in-context learning setting concatenates the same training documents (10/100/200 examples, filtered by relevance to the evaluation prompt) into the context, does not allow chain of thought, and is evaluated with GPT-3.5.
  4. What experiments did the paper conduct?

    GPT-3.5/4 exceed baselines on OOCR across all five tasks and outperform in-context learning with the same data; GPT-4 is stronger across the board, but OOCR is unstable.

    Experimental setup

    • Models tested: GPT-3.5 (gpt-3.5-turbo-0125/1106/0613, depending on task) and GPT-4 (gpt-4-0613), trained via the OpenAI fine-tuning API; Parity Learning additionally tests Llama 3 8B and 70B (LoRA fine-tuning); GPT-4o is used only for supplementary in-context learning evaluation on Locations.
    • Tasks and data: Five self-constructed tasks (Figure 2); training scale 6,000–96,000 documents, all 1 epoch (Coins is 4 epochs).
    • Number of repetitions: Locations 10 GPT-3.5, 5 GPT-4 fine-tunes; Functions 10 GPT-3.5; Mixture of Functions 20 GPT-3.5, 10 GPT-4; Coins 24 GPT-3.5, 8 GPT-4; Parity Learning 10 GPT-3.5, 5 GPT-4, 10 each for Llama 3.
    • Metrics and criteria: Mean P(target) (probability of the correct answer, approximated by sampling for multi-token; the Parity overview figure normalizes over syntactically valid answers); Locations training task uses median distance error; Coins/Mixture/Parity training tasks use 1 − Mean TVD; error bars are bootstrap 90% confidence intervals.
    • Baselines: Shuffled-prompt baseline (most evaluations), untrained model (multiple-choice evaluations), in-context learning (10/100/200-shot, GPT-3.5).

    Main results

    The authors report that GPT-3.5 and GPT-4 exceed baselines on OOCR across all five tasks (Figure 4, Figure 29), and GPT-4 outperforms GPT-3.5 on all four tasks tested (Figure 4 right; GPT-4 not tested on Functions due to cost). Representative numbers that can be checked:

    Swipe horizontally to read the table

    TaskEvaluationModelOOCRBaselineSource
    FunctionsFree-form (write function definition)GPT-3.50.43 ± 0.050.03 ± 0.00Figure 3
    FunctionsLanguage (multiple choice)GPT-3.50.74 ± 0.030.20 ± 0.00Figure 3
    FunctionsCompositionGPT-3.50.23 ± 0.010.08 ± 0.00Figure 3
    FunctionsFunction inversionGPT-3.50.60 ± 0.010.11 ± 0.01Figure 3
    LocationsCity Free-form (state city)GPT-3.556%Paper does not give a number for this cellMain text 3.3
    LocationsFood multiple choice (foods of neighboring countries as distractors)GPT-3.557%Paper does not give a number for this cellMain text 3.3
    Parity LearningVariable values (average)GPT-3.580%Below 50% (some evaluations)Appendix G.4
    • The authors state that GPT-4 consistently outperforms GPT-3.5 on OOCR across four tasks, while in-distribution training tasks improve only on Locations (error from about 280 to about 180), with no improvement on Coins, Mixture of Functions, or Parity Learning; the authors take this to suggest that the OOCR improvement is not merely better in-distribution learning.
    • The authors consider the results to suggest that inductive OOCR ability may improve with scale, but because architectures and fine-tuning methods may differ, more careful experiments are needed to conclude.

    Comparison with in-context learning

    • What was tested: The same training documents and evaluations, but with 10/100/200 documents concatenated into the context (GPT-3.5), with chain of thought not allowed; on the fine-tuning side, a single evaluation prompt is related to at most 32,000 training samples (Parity Learning).
    • Results: Figure 4 (left) shows that ICL is worse than fine-tuning on all tasks; there is almost no improvement from 10 to 200 shot. On Locations, Coins, and Parity Learning, ICL essentially fails (does not exceed baseline, Appendices C.1.1, D.2, G.6); on Functions and Mixture of Functions, ICL exceeds baseline but is still weaker than fine-tuning (Appendices E.1.2, F.1.2).
    • Authors' interpretation: The poor ICL performance indicates the tasks are hard and unlikely to be solved by simple pattern matching, and that the model is unlikely to recall training samples in a single forward pass at test time to infer the latent value; the latent value is more likely learned during fine-tuning; the authors also note that the tasks were chosen to demonstrate OOCR and were not optimized for ICL, and that in preliminary experiments GPT-4's ICL was uniformly better.

    Task-specific findings and negative results

    • Instability of Functions: In the free-form definition evaluation, the model can write most simple functions but performs poorly on more complex affine functions (Figure 7); x + 5 shows no sign of OOCR while x − 1 is about 65% (Figure 19); the authors list three possible hypotheses—response patterns, effect of variable names, and experimental noise—and do not reach a conclusion. Composition and addition/subtraction evaluations exceed baseline by only 6% and 20% respectively, which the authors call a weak (but statistically significant) ability for compositional latent variables. On functions with large constant addition/subtraction (e.g., x + 883), the model can still write definitions and invert (Appendix E.2).
    • Calibration problems in Coins: The learned bias is stronger than the true value (e.g., when the true value is 0.8, all models believe it exceeds 0.9, Figure 16); reflection evaluations exceed baseline but absolute values are low, all models prefer to answer 0.8, but models trained on 0.8 have a stronger preference—22 of 24 GPT-3.5 fine-tunes and 8 of 8 GPT-4 fine-tunes can be correctly classified by assigned probability; GPT-3.5 fails at distinguishing biased/fair coins, while GPT-4 performs well on both downstream tasks (Appendix D.2).
    • Low absolute performance in Mixture of Functions: Without variable names, the training distribution is learned near-perfectly, but reflection (multiple-choice identification of all functions used) has poor absolute performance and is only above baseline (Figure 9); the model can identify the number of functions and the maximum/minimum possible output.
    • Out-of-distribution decline in Locations: The training task has an average error of 283 km in-distribution (cities ≥2000 km), and performance declines for out-of-distribution cities <2000 km; the authors suggest this may be because the model has difficulty outputting out-of-distribution distances; direction prediction is trivial, with 100% accuracy (Appendix C.3).

    Other ablations and analyses

    • Llama 3 reproduction (Appendix G.5): On Parity Learning, both 8B and 70B exceed baseline; 8B is better on reflection (print), and 70B is better on string and control evaluations (Figure 30).
    • GPT-4o's ICL (Appendix C.1.3): On the Locations training task and free-form queries, ICL improves over GPT-3.5 but is still worse than what fine-tuning can achieve (other queries not evaluated due to cost).
    • Sample size needed for Coins (Appendix D.6): At least 122 samples are needed to distinguish 0.7 and 0.8 biases with 90% confidence, and 200 for 95%.
    • Parity normalization (Appendix G.3.1): Fine-tuned models often give syntactically invalid answers; the overview figure normalizes over valid answers so that the baseline is 50%, facilitating comparison with ICL.
  5. What are some points that can be further explored?

    The authors point out three limitations: API fine-tuning is a black box, specialized datasets, and high variance in OOCR, and list directions such as more realistic tasks, scaling effects, and mechanistic research.

    Limitations and future directions noted by the authors

    • OOCR has high variance and is sensitive to prompts (Section 4): Performance can be both high-variance and prompt-sensitive, especially on more complex latent structures such as Mixture of Functions; the authors consider it unlikely that current models would exhibit this ability in safety-relevant scenarios, because that would require much more complex out-of-context reasoning.
    • Black-box nature of API fine-tuning (Section 4): No access to model architecture, training set, or fine-tuning algorithm; the authors suggest that scaling effects merit careful study within a single model family, rather than only comparing GPT-3.5 and GPT-4.
    • Purpose-built datasets (Section 4): The data were specifically constructed for the model to learn particular latent structures; although Mixture of Functions has no variable names, it still relies on the model associating information with a specific prompt format; more realistic scenarios would require learning from heterogeneous pretraining-style data, which may be harder, though more diverse data may also help.
    • Future directions (Section 5 footnote, Section 6): Study in-context learning with chain of thought; explore the number of samples required for inductive OOCR; develop more realistic, safety-relevant OOCR tasks; study the effect of model scale more carefully; study mechanistically how models learn and represent latent values.

    Scope of experiments

    • Models tested are GPT-3.5, GPT-4 (GPT-4 not tested on Functions), and Llama 3 8B/70B (Parity Learning only), 4 models in total; GPT-4o is used only for supplementary ICL evaluation on Locations.
    • Tasks cover 5 self-constructed tasks: geography (Locations), random aggregation (Coins), functions (Functions), function mixture without variable names (Mixture of Functions), and Boolean assignment (Parity Learning).
    • Number of fine-tuning repetitions: 5–24 per task (e.g., Coins 24 for GPT-3.5, 8 for GPT-4; Locations 10 for GPT-3.5, 5 for GPT-4).
    • Controls are in-context learning (10/100/200-shot, GPT-3.5) and shuffled-prompt/untrained-model baselines; the paper does not report a comparison of OOCR with ICL using chain of thought.
    • The evaluation metric is the probability the model assigns to the correct answer (Mean P(target)); the paper does not report human evaluation.
  6. Summarize the main content of the paper

    The authors propose inductive OOCR and build a five-task suite: GPT-3.5/4 can aggregate implicit cues in fine-tuning data to infer latent variables, outperforming ICL, but unstably.

    A safety analysis paper on the implicit learning ability of LLMs. The authors propose inductive out-of-context reasoning (inductive OOCR): after fine-tuning on documents that contain only indirect observations of a latent variable, the model can, at test time, with no in-context examples and no chain of thought, infer and state the latent variable and use it for out-of-distribution downstream tasks.

    • Motivation: Deleting dangerous facts from training data may leave scattered implicit evidence; if an LLM can aggregate this evidence across documents, monitoring what the model has learned becomes harder, and this relates to threat models of deceptive alignment failure.
    • Method: Formalized as "latent variable z + training distribution + out-of-distribution evaluation distribution", with five tasks constructed (Locations, Coins, Functions, Mixture of Functions, Parity Learning), fine-tuning GPT-3.5/4 via the OpenAI API, with shuffled-prompt baselines and in-context learning as controls.
    • Main results: The authors report that GPT-3.5/4 exceed baselines on all five tasks—in Locations, GPT-3.5 states the correct city on average 56% of the time, and 57% on food multiple choice; in Functions, free-form definitions give Mean P(target) 0.43 ± 0.05 (baseline 0.03); in Parity Learning, an average 80% probability is assigned to the correct variable values; in Coins, 22 of 24 GPT-3.5 fine-tunes can distinguish 0.7/0.8 biases by assigned probability.
    • Comparison: With the same data, in-context learning (up to 200-shot) is worse than fine-tuning on all tasks, and on Locations, Coins, and Parity Learning it essentially does not exceed baseline; GPT-4 outperforms GPT-3.5 on OOCR in all four tasks tested, and in three of those tasks shows no improvement in in-distribution performance.
    • Negative results: OOCR is unreliable—some functions are not learned in Functions (e.g., x + 5), absolute performance is low in Mixture of Functions, and in Coins the learned bias is stronger than the true value.
    • Authors' conclusion: Current LLMs are already capable of inductive OOCR in simple domains, but the authors consider it unlikely to arise in safety-relevant scenarios; this ability poses a potential obstacle to monitoring and controlling what LLMs have learned, and merits further study on more realistic tasks, scaling effects, and mechanisms.
Read originalarxiv.org