arXiv:2609.05801cs.AISep 2026

Manuscript Offprint

arXiv:2609.05801

Evidence-Aligned Local Composition of Discrete Experts for Sequence Restoration

Mohammad Panahazari, Usman A. Khan, Shuchin Aeron

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

A document modeled as a discrete sequence of tokens can be thought of as being generated from a composition of texts from different domains; a README file, for example, moves between prose, code, and configuration. When such a document is corrupted and only frozen domain experts are available, restoring it requires deciding both what is missing and which expert to trust at each position, at test time and without region labels or a trained router. We introduce evidence-aligned local composition, which infers a soft, position-wise weighting over the experts from the marginal evidence of the corrupted observation under a given corruption model, estimating the evidence from the experts' own denoising losses and smoothing the weights across positions. Because the weighting is soft, it recovers a mixture when the true composition is mixed and concentrates on one expert when that suffices. Across a categorical simulator, byte-level experts, and experts fine-tuned from a 1.3B discrete flow-matching model, the inferred weights track the true regions at 0.85 field accuracy on naturally mixed scientific documents, and at 0.98 on constructed mixtures whose regions are lexically disjoint. Restoration improves over a single global weight when the experts are genuinely distinct and reduces to it when they converge, tracking a measure of expert separation. Code is available at https://github.com/panahazari/evidence-aligned-local-composition.

1 Introduction

Real documents mix several kinds of content. A software README interleaves prose, code, and configuration; a scientific article interleaves prose and mathematics; a data-processing script embeds queries in a host language. When such a document is damaged, by imperfect optical character recognition, a lossy channel, or aggressive filtering during data curation, restoring it means recovering the missing symbols. We call this channel a corruption channel, or forward model, and we assume access to it, expressed as the likelihood of the corrupted output conditioned on the true input.

Strong generative priors for each kind of content already exist as frozen, separately trained models, yet no single one serves a whole document well: the best expert changes from position to position, and

*¹ Department of Electrical and Computer Engineering, Tufts University, Medford, Massachusetts ² Boston College, Chestnut Hill, Massachusetts E-mail: mohammad.panahazari@tufts.edu, usman.khan@bc.edu, shuchin@ece.tufts.edu

Table 1: Methods along our three axes and their data domain. Local: the weights vary by position within one input, rather than one weighting being applied to the whole input. Test-time: the weights are set at inference from the input itself, with no router or weight predictor trained beforehand. Corruption-aware: inferred from the corrupted observation under a given channel. wPoE optimizes a single scalar at test time from one data point, so it is test-time but not local.

MethodExpertsDomainLocalTest-timeCorruption-aware
Composable diffusion [2, 3]continuous diffusionimage✕✓✕
DEMix [9]autoregressive LMstext✕✓✕
PackLLM [4]autoregressive LMstext✕✓✕
wPoE [5]autoregressive LMstext✕✓✕
FactorDiff [10]discrete diffusionimage✓✓✕
Evidence-optimized priors [7]continuous diffusionimage✕✓✓
Oursdiscrete flow matchingtext✓✓✓

the regions carry no labels. We study how to restore such a document at test time by composing frozen domain experts, inferring at each position both what symbol is missing and which combination or composition of experts to trust, without position labels or a trained model, i.e. a router for composition. We do not assume a single expert per position. The object we infer is a composition of experts at each position; routing to one expert is the special case in which the composition concentrates on a single vertex of the simplex.

This poses two coupled problems: the missing content must be inferred, but also the composition of the experts that should guide each position. Weighted products of experts, or equivalently weighted sums of their log probabilities, provide a natural way to compose models [1–3]. However, most existing approaches assign one weight to each expert for the entire sequence [4], which works when expert competence is roughly uniform but not when the preferred composition changes across positions. Local positional weights offer the needed flexibility but are usually supplied by supervision or a trained router, while the test-time mixtures that need no training fix one weight for the whole sequence, chosen from the input's own likelihood [4, 5]; Table 1 places these lines along the three axes that define our setting. Our question is different: Can a soft field of expert weights be inferred at test time from the corrupted observation and the given corruption channel, without region labels or router training?

We approach this question through marginal evidence: the position-dependent weights parameterize a composed prior, and the likelihood of the observation determines how they should change [6], connecting to evidence optimization and model selection for continuous-diffusion priors [7, 8] but making the weights local and discrete. The resulting update compares each expert's fit to the observation with its fit under the current composition, a posterior-minus-prior difference we make precise in Section 4. Because the exact update is not directly computable, we approximate it, which motivates the name evidence-aligned local composition.

References (36)