ProgMeta-ICL: Meta-Learning with In-Context Learning
- ProgMeta-ICL is a family of meta-learning approaches that combine meta-interpretive strategies with in-context learning to tackle logic program synthesis, prompt structuring, and log parsing.
- It employs progressive adaptation over demonstration budgets and advanced abstractions like three-valued logic to enhance generalization and efficiency across tasks.
- Empirical evaluations show significant improvements in synthesis speed and parsing accuracy, highlighting the method’s capacity for robust latent predicate invention and adaptive resource allocation.
ProgMeta-ICL is a family of progressive meta-learning approaches unified by their joint use of meta-interpretive or meta-learning strategies with in-context learning (ICL). The term encompasses distinct methodologies applied in logic program synthesis, LLM prompt structuring, and log parsing, each addressing domain-specific challenges in generalization, adaptation, and efficiency. Across implementations, ProgMeta-ICL leverages meta-learning frameworks that facilitate learning over progressive task complexities or prompt formats, supporting multi-predicate invention, robust generalization to new tasks or domains, and efficient utilization of demonstration resources.
1. Formal Problem Definition and Motivation
In logic-based settings, ProgMeta-ICL refers to the extension of meta-interpretive learning (MIL) frameworks where the system is tasked with reverse engineering programming language semantics from input/output evaluation examples. For a set of abstract syntax trees (ASTs) representing program terms and a subset of values (fully reduced terms), the learning environment is defined by:
- An opaque interpreter , mapping programs to results or divergence.
- Background knowledge , typically partial Prolog definitions (e.g., for ).
- A hypothesis space of clauses over predicates such as , , .
The objective is to synthesize a finite such that for all , :
Motivations for such ProgMeta-ICL approaches include:
- Enabling abstraction over language constructors and predicate names.
- Handling non-terminating (divergent) evaluation cases efficiently.
- Learning latent, non-observed predicates critical to program semantics (Bartha et al., 2019).
In LLM-based settings, ProgMeta-ICL is instantiated for efficient and adaptive in-context learning, particularly in resource-constrained or highly variable environments:
- Progressive adaptation to a range of demonstration budgets (zero-shot to -shot), with meta-training attuned to increasing information.
- Meta-learned token structures or prompt schemata to standardize and optimize adaptation to new tasks or data distributions.
- Efficient sampling, retrieval, and caching to mitigate query cost and data scarcity (Yu et al., 11 Jan 2026, Brunet et al., 2023).
2. Methodological Foundations and Extensions
Meta-Interpretive Learning with Function-Symbol Abstraction
ProgMeta-ICL extends standard Metagol MIL by supporting variables in function-symbol positions, not just predicates. Compound terms are represented in "univ" list form , and the meta-interpreter instantiates such function variables via Prolog's operator during proof search.
Core meta-rule templates include:
- Chain:
- Unary unfold:
- Value-introduction:
Such abstraction supports synthesis of constructs (e.g., , , ) without hardcoding names and facilitates reasoning over AST constructors (Bartha et al., 2019).
Three-Valued, Depth-Bounded Examples
To accommodate divergence, ProgMeta-ICL incorporates three-valued logic:
- Positives must succeed within depth .
- Negatives must finitely fail within .
- Divergent examples are flagged as “” if depth bound is exceeded, forming constraints on hypotheses.
The interpreter tracks a depth counter (e.g., in ) and restricts hypothesis to correctly classify all three categories (Bartha et al., 2019).
Multi-Predicate, Latent Predicate Invention
Learning is not limited to directly observed predicates. By marking background predicates (e.g., , ) as "interpreted," ProgMeta-ICL recursively switches into learning mode if such a predicate is incompletely defined, synthesizing subroutines as needed in the course of proving the observed task (e.g., ). This enables joint induction of multiple interdependent logic definitions (Bartha et al., 2019).
Progressive Meta-Learning in LLM-ICL
In LLM-based implementations, ProgMeta-ICL employs meta-training over a sequence of ICL conditions (zero- to -shot):
- Each meta-task cycles through tasks with increasing numbers of demonstration examples.
- The LLM is conditioned during training to robustly utilize whichever () is encountered at inference.
- Enhanced sampling (weighted DBSCAN) increases coverage of complex or rare cases.
- Enhanced demonstration selection (BM25 with ordering) improves relevance and prompt robustness (Yu et al., 11 Jan 2026).
Meta-Learned Prompt Structure in ICL
ICL Markup instantiates ProgMeta-ICL by learning a set of soft-token tags , whose embeddings are trained via meta-learning while the LLM itself is frozen. These tags are inserted at structural points in prompt templates to encode task components (demonstration, input, label etc.), thereby standardizing formatting and removing reliance on prompt engineering (Brunet et al., 2023).
3. Implementation Strategies and Procedural Flow
Algorithmic Steps in Logic Program Synthesis
- Encode compound term structure using "univ" list representation.
- Define meta-rules with potential function-symbol variables.
- Manage derivation with a global depth bound for three-valued example handling.
- At proof time:
- Attempt to prove observed predicates.
- If an interpreted, under-defined predicate is encountered, invoke learning for it.
- Aggregate induced clauses, updating background knowledge iteratively.
Algorithmic Steps in LLM-Based Log Parsing
- Weighted-DBSCAN over deduplicated log stream with token/length-based complexity scores yields representative meta-training and inference pools.
- BM25 is used to select and order demonstration examples for prompt construction.
- A multi-level cache (exact-match LRU, normalized-pattern) accelerates repeated parsing and minimizes LLM queries.
- At inference, the LLM is presented a prompt structured with labeled examples according to the meta-trained paradigm.
Meta-Learning Objective
The meta-learning loss combines expected ICL loss over meta-task distribution:
with ICL loss for task :
Soft-token tag learning in ICL Markup can be formalized as tuning the tag embedding parameters (with the LLM frozen) to minimize expected negative log-likelihood of over sampled warm-up tasks (Brunet et al., 2023).
4. Experimental Evaluations and Empirical Performance
Logic Program Synthesis
ProgMeta-ICL was evaluated on small-step semantics extensions over the untyped -calculus:
- Constructs: pairs, lists, conditionals, and evaluation strategies.
- Results:
- Each extension learned in under 0.2 s, synthesizing 3–6 clauses.
- Sequentially, 25 clauses induced per staged run (also <0.2 s/stage).
- Learning time grows exponentially with theory size; example order heavily impacts runtime (10× speedups observed with reordering).
- Validated ability to abstract over function symbols, accommodate divergences, and simultaneously invent latent subroutines (Bartha et al., 2019).
LLM-Based Log Parsing (MicLog)
- Loghub-2.0 benchmark (14 datasets).
- Metrics: Parsing Accuracy (PA), Template Precision/Recall.
- Performance:
- MicLog (ProgMeta-ICL) achieves 97.6% PA (+10.3% over AdaParser), 95.3% PTA (+12.6%), and 90.5% RTA (+6.1%).
- Efficiency: Parsing time reduced by 42.4% vs AdaParser; cache lookup reduced from 376.5 s (LILAC) to 63.5 s.
- Ablation: removing ProgMeta-ICL drops PA to 87.3% (−10.3%); removing weighted-DBSCAN or ordering reduces accuracy by 2.9–3.9%.
- Robustness: lowest variance and highest median across datasets (Yu et al., 11 Jan 2026).
Prompt Structure Learning (ICL Markup)
- News, intent, and legal text classification tasks with task/domain shifts.
- Results:
- HuffPost News: +5.9 p.p. accuracy over best hand-written prompt; +5.2 p.p. over PBML baseline.
- Intent datasets: ICL-MU matches or exceeds performance of rule-based prompt-tuning without LLM finetuning.
- Legal classification: +2.5 p.p. over vanilla Flan-T5-XL; statistically significant improvement ().
- Reduces performance variance and eliminates sensitivity to prompt design choices (Brunet et al., 2023).
| Implementation | Domain | Notable Results |
|---|---|---|
| Logic MIL (Bartha et al., 2019) | Program synthesis | 0.2 s/construct, 3-6 clauses/stage |
| MicLog (Yu et al., 11 Jan 2026) | Log parsing | 97.6% PA, −42.4% time |
| ICL Markup (Brunet et al., 2023) | Prompt learning | +5.9 p.p., less variance |
5. Hyperparameters, Design Choices, and Limitations
Key Hyperparameters and Tuning
- for logic derivations (Bartha et al., 2019).
- Maximum for progressive ICL, meta-trained over shots (Yu et al., 11 Jan 2026).
- Weighted-DBSCAN: , .
- Sample ratio ; pattern cache .
- Soft-token tag vocabulary: 14–23 entries assigned by role (Brunet et al., 2023).
Advantages
- Adaptive resource allocation for demonstration usage (progressive -shot ICL).
- Robust generalization to new task distributions, categories, and objectives.
- Efficient online performance and amortized demonstration/sample selection.
- Reduces arbitrary prompt engineering axes.
Limitations
- Up-front meta-training required, albeit with small data in some cases (≈300 examples).
- Sensitivity to clustering and batch-of-tasks scheduling.
- Cache cost may escalate with highly diverse or adversarial inputs.
- In logic MIL, exponential scaling with induced theory size is observed.
- Some domain-specific implementations limited to classification and small model scales (Brunet et al., 2023).
A plausible implication is that the efficiency and generality benefits of ProgMeta-ICL may extend to broader generative and multi-modal tasks as future work.
6. Theoretical and Practical Significance
ProgMeta-ICL demonstrates that progressive meta-learning over in-context demonstration budgets, function-symbol abstraction, and meta-learned prompt structures can overcome several long-standing limitations in program synthesis, log parsing, and input-output adaptation for LLMs. Empirical results highlight substantial improvements in accuracy, robustness, and efficiency across domains.
By integrating latent predicate invention, depth-bounded three-valued reasoning, and learned prompt formalism, ProgMeta-ICL realizes flexible yet principled frameworks for both symbolic and neural learners. The standardized strategies for demonstration selection, prompt composition, and recursive hypothesis induction provide fundamental mechanisms for scalable, automatable knowledge acquisition in data- and domain-diverse environments (Bartha et al., 2019, Yu et al., 11 Jan 2026, Brunet et al., 2023).