Submodular Context Partitioning and Compression for In-Context Learning

In-context learning (ICL) enables efficient few-shot learning in large language models (LLMs) without training, but suffers from the quadratic input complexity of transformers, limiting the maximum number of exemplars. While various efficient ICL approaches partition the context into blocks to process (e.g., ensembling, compression, cross-attention), they often ignore the information redundancy or under-representation caused by different partition strategies, leading to suboptimal performance. To tackle this problem, we propose Sub-CP, a block-aware context selection framework that leverages submodular objectives to control block diversity. Sub-CP supports a flexible spectrum of selection strategies, allowing each block to range from globally diverse to locally coherent. This allows fine-grained control over semantic structure while enabling precomputation. Extensive experiments across diverse tasks on multiple datasets show that Sub-CP consistently improves performance across model scales.

Paper

References (14)

07Submodular functions and optimization , volume 582005
08Learning question classification2002 · COLING
092023a. Context compressor: Context optimization via diffusion model for in-context learningarXiv preprint
102022. Iccl: Instance-wise control for compositional generalization in prompt learningNeurIPS
112024. Giraffe: Long context understanding in llms via representational fusionarXiv
122023b. Gist: Interpretable and generalizable in-context learning with selection and transformationICLR

Scroll for more · 2 remaining

Similar papers

© 2026 NYSGPT2525 LLC