Skip to main content

Module saliency

Module saliency 

Source
Expand description

Saliency Map — information-theoretic chunk ranking and deduplication.

Implements two key algorithms from recent information theory:

ECS (Entropic Context Shaping, arXiv 2025): Scores each chunk by its pragmatic utility — how much it shifts the LLM’s output distribution toward the correct answer. Operationalized as a composite of task relevance, graph centrality, and information density.

MIG (Marginal Information Gain, COMI 2025): Removes redundant chunks by measuring each chunk’s marginal contribution given the already-selected set: MIG(c_i) = Relevance(c_i) - Redundancy(c_i, selected).

Scientific basis: Saliency maps (Itti & Koch 2001) + lateral inhibition (V1 cortex) for competitive chunk selection.

Structs§

EcsWeights
Weights for the ECS composite score.
SaliencyScore
Saliency score for a single chunk.

Functions§

compute_ecs_scores
Compute ECS saliency scores for a set of chunks.
mig_select
Select top-k chunks using MIG: Marginal Information Gain.