Shared Randomness and Parallel Rounds in Permutation Sampling
Haoxiang Huang
AI 速读 基于摘要
本文确定了并行置换采样中共享随机性与轮数之间的精确权衡,并给出了误差容忍下的种子节省量。
cs.IT · cs.DS
查看原文摘要
Sampling a uniformly random permutation of $[n]$ in parallel is a coordination problem: $n$ processors, one per coordinate, must output distinct values. A single round requires a shared seed of $\log n!$ nats, while $n$ rounds require no shared randomness. We determine the tradeoff in between for $R$ rounds, in which the values of each round are written independently given the shared randomness and the earlier output, and the output must be a uniform permutation, exactly or within total-variation error $\varepsilon$. Shared randomness is measured by its support size or by its entropy, and it is either fixed in advance or drawn adaptively during the execution. For exact sampling, all four costs equal one explicit combinatorial quantity up to an absolute additive constant. A fixed error $0<\varepsilon<1$ shortens the seed by $O(1)$ nats in one round, where the least number of seed values, an approximate nonnegative tensor rank, is $(1-3\varepsilon/2)\,n!$ up to an additive two for $\varepsilon\le1/2$. The saving is $Θ((\log n)^2)$ nats in two rounds, with a sharp constant, and of lower order for $R=o(n)$; for $R\simρn$ with $0<ρ<1$ it is linear in $n$, with the optimal rate given by a variational formula. Here, errors above an explicit threshold need only $o(n)$ nats, and at every positive error below it, shared randomness drawn adaptively has strictly smaller entropy than a seed fixed in advance. A central tool is a change of measure that turns lower bounds with error into entropy bounds for a single batch of distinct, nearly independent values. The results for sublinearly and linearly many rounds extend to sampling without replacement.
Rapidly evolving LLM architectures and heterogeneous mobile hardware make supporting new models in on-device inference engines a recurring and costly system challenge. Each model may require coordinated changes across conversion, graph construction, operators, and hardware backends. Existing coding agents often miss these cross-layer dependencies and struggle to diagnose failures across host--device execution paths. We present EngineAgent, an agentic system for automating on-device LLM model enablement. Its key insight is to separate reusable engine and hardware knowledge from model-specific implementation. Before enablement, EngineAgent constructs a hierarchy-aware engine index that captures engine abstraction layers and cross-layer dependencies, and pre-validates backend-specific build, execution, and debugging workflows using already supported models. For each new model, a builder uses this knowledge to coordinate cross-layer changes, while an auditor checks implementation completeness and drives iterative debugging through device-side validation. Across 12 tasks spanning three mobile LLMs and four engine--backend pairs on CPUs, GPUs, and NPUs, EngineAgent achieves 75% end-to-end success with either of two underlying LLMs, versus 33.3% for the strongest coding-agent baseline. Success requires compilation, on-device execution, and output-logit agreement with reference implementations. EngineAgent also reduces average per-task time and model-API cost relative to baselines using the same underlying LLMs.