SIEVE-GEN: Cache-Aware & Synthetic Sieve Systems
- SIEVE-GEN is a term referring to distinct sieve-oriented generation systems that optimize resource use by decomposing computation into smaller, targeted segments.
- In prime generation, it employs cache-aware segmentation, odd-only bit-packing, and cache-line alignment to reduce memory usage by up to 8× and improve runtime performance.
- In natural-language learning, SIEVE-GEN drives synthetic data pipelines through careful context decomposition and backtranslation, boosting sample efficiency from minimal examples.
SIEVE-GEN is a label used in recent arXiv literature for distinct sieve-oriented generation systems rather than for a single unified method. In computational number theory, it denotes a cache-aware prime generator built around a hybrid sieve that combines classical Eratosthenes logic, segmented processing tuned to cache sizes, bit-packing, and cache-line-aligned blocks (Thirdhana, 13 Dec 2025). In natural-language learning, it denotes the synthetic data generation pipeline at the core of SIEVE, where decomposed context units are used to generate synthetic query–context pairs for context distillation (Asawa et al., 2 Feb 2026). A related usage appears in large-scale prime-gap search, where the “Combined Sieve” is explicitly described as a high-throughput sieve generator over many intervals at once (Troisi, 2020).
1. Terminological scope
The term has domain-specific meanings, but each usage centers on selective generation under structural constraints.
| Usage | Domain | Core mechanism |
|---|---|---|
| SIEVE-GEN | Prime generation | Hybrid sieve with segmentation, odd-only bit-packing, and cache-line alignment |
| SIEVE-GEN | Natural-language learning | Synthetic data generator using context decomposition, backtranslation, and verification |
| “SIEVE-GEN” concept | Prime-gap search | Batched multi-interval sieving with shared residue precomputation |
In the prime-generation sense, SIEVE-GEN is presented as “a high-performance, cache-aware prime generator” whose design is explicitly architecture-aware. In the learning sense, SIEVE-GEN is “the synthetic data generator at the core of SIEVE,” used to amplify as few as three real query examples into a large synthetic training set. In the prime-gap setting, the term is used descriptively: the Combined Sieve can be viewed as a sieve generator specialized for many related intervals of the form (Thirdhana, 13 Dec 2025).
A plausible implication is that the shared name reflects a common engineering motif: each system avoids brute-force processing of a monolithic search space by decomposing it into smaller, more relevant units before generation or filtering.
2. Cache-aware SIEVE-GEN for prime generation
In "A Cache-Aware Hybrid Sieve Combining Segmentation and Bit-Packing for Fast Prime Generation" (Thirdhana, 13 Dec 2025), SIEVE-GEN is a prime generator designed for modern CPU memory hierarchies. The stated motivation is that the classical Sieve of Eratosthenes, while asymptotically , becomes practically limited by cache misses and memory bandwidth once the sieve array exceeds L1/L2/L3 capacity.
The implementation combines four elements. First, it retains classical Eratosthenes logic. Second, it uses segmented processing tuned to cache sizes, so that the active block fits comfortably in L1. Third, it stores only odd numbers and uses one bit per value. Fourth, it uses cache-line-aligned blocks, specifically 64-byte alignment, to improve prefetch behavior and reduce cache-line inefficiency. The odd-only mapping is given by
with segment-local indexing obtained by subtracting the first odd number of the segment. This yields an approximate total representation cost of
up to , while preserving the classical time complexity and an active-memory footprint of (Thirdhana, 13 Dec 2025).
The cache model is central rather than incidental. With a 32 KB L1 data cache, the paper describes a 32 KB active bitset, or about bits, representing approximately odd numbers and therefore a range width of roughly integers. Base primes up to 0 are computed once and reused across all blocks. The first multiple marked inside a segment starts at
1
then is shifted to the next odd multiple if needed, and the inner marking loop advances by 2 because only odd multiples are represented.
The paper’s reported savings are practical rather than merely asymptotic. It states up to an eight times reduction in memory usage and runtime improvements of up to 3 compared to the classical sieve and 4 compared to the segmented sieve, with benchmarks up to 5 (Thirdhana, 13 Dec 2025). The accompanying discussion notes that the 6 figure likely assumes a byte-per-odd baseline; compared to a byte-per-integer array, the odd-only bit representation corresponds to a 7 reduction.
3. Multi-interval sieve generators for prime-gap search
In "Combined Sieve Algorithm for Prime Gaps" (Troisi, 2020), the sieve-generator idea is generalized from one contiguous interval to many nonadjacent intervals processed simultaneously. The target numbers are of the form
8
and the intervals of interest are 9 for many coprime values of 0. The key idea is to avoid treating each interval as an independent segmented sieve.
The algorithm partitions primes into “small” and “large” regimes. For all sieving primes 1, it precomputes and caches 2, which converts repeated big-integer residue computation into 64-bit arithmetic: 3 For small primes, nearly every interval contains a multiple, so the method resembles repeated segmented sieving. For large primes, most intervals contain no multiple of 4, so the paper replaces exhaustive checking by a modular-interval search. The relevant condition is
5
and the paper defines a recursive solver
6
the smallest solution to 7, with recursion depth 8.
This changes the cost model. Instead of paying for all 9 intervals for each large prime, the sieve only touches the 0 intervals in which the prime actually hits. The paper characterizes this as a space-time tradeoff and a novel solution to a modular equation, and states that the resulting algorithm “regularly runs 10,000× faster” than a traditional sieve when handling many intervals concurrently. In the end-to-end prime-gap pipeline, deeper sieving eliminates more composites before BPSW-style primality testing and accelerates the overall search by 1. During development and testing, two top-10 record merit prime gaps were found (Troisi, 2020).
This version of SIEVE-GEN is not a prime enumerator in the classical sense. It is a batched interval-sieving engine specialized for structured arithmetic families, with explicit emphasis on amortizing residue computation and touching only intervals that must actually be updated.
4. SIEVE-GEN in sample-efficient parametric learning
In "SIEVE: Sample-Efficient Parametric Learning from Natural Language" (Asawa et al., 2 Feb 2026), SIEVE-GEN is an offline synthetic data generator used to internalize natural-language context into model weights. Its input is a context corpus 2, a base model 3, an instruction-tuned model 4, a small seed set of queries 5, and a target size 6. Its output is a dataset
7
where 8 is a synthetic query, 9 is the verified applicable subset of context units, and 0 is the rollout generated by 1 conditioned on 2 and 3.
The pipeline has three named phases. In Decomposition, the instruction model breaks 4 into atomic, independently evaluable context units 5. In Backtranslation, the base model samples a subset of 3–5 units as seed context, and the instruction model generates a realistic query that would require them. In Verification, the instruction model determines which units are actually necessary for the generated query, producing the applicable subset 6. The underlying premise is stated explicitly: “natural language context is decomposable” (Asawa et al., 2 Feb 2026).
SIEVE-GEN is paired with context distillation. A teacher model sees 7, while the student sees only 8. The loss is a KL divergence from the top-9 teacher distribution to the student: 0 with temperature 1 and top-2. The paper reports that this allows parametric learning from as few as three real query examples. On Retail, the reported comparison is 3 accuracy for vanilla context distillation with full context, 4 for synthetic queries with full context, and 5 for SIEVE using filtered applicable context. The paper also reports that SIEVE surpasses ICL by 6 on Retail, yields a 7 absolute improvement over V_CD-S on RuleArena, and achieves 8 chrF on MTOB versus 9 for Cartridges (Asawa et al., 2 Feb 2026).
In this usage, SIEVE-GEN is not a sieve over integers. It is a selective synthetic generator whose sieve-like action lies in filtering context to the units necessary for each query.
5. Generalized sieve-generator viewpoints
Several of the supplied papers treat sieve generation as a broader design pattern rather than as a single algorithm. The semidefinite framework paper describes a canonical SDP template for upper-bound sieving: given a finite set 0, a family of partitions 1, avoidance parameters 2, and a chosen family 3, one defines cones 4 and 5 and solves for matrices 6 and a scalar 7 satisfying
8
with 9. The paper states that this yields a general “SIEVE-GEN” system for upper-bound sieving under a chosen semidefinite relaxation (Brady, 2021).
A different abstraction appears in Holt’s dynamical-systems treatment of Eratosthenes’ sieve. There the sieve is a deterministic generator of admissible constellations across stages 0, with a three-step recursion and a mixed-radix “primorial coordinates” representation
1
The paper argues that every admissible instance of every admissible constellation arises and persists within the sieve, with relative populations governed by multiplicative local factors analogous to Hardy–Littlewood singular-series weights (Holt, 27 Feb 2025).
Taken together, these works suggest that “SIEVE-GEN” can denote at least three levels of abstraction: an optimized implementation, a batched computational engine, or a formal generative framework for sieve dynamics and bounds. This suggests that the unifying concept is not the data type being processed, but the disciplined restriction of computation to structured survivors.
6. Limitations and open directions
The prime-generation SIEVE-GEN remains bounded by the classical asymptotic complexity and gains mainly through constant-factor improvements. The paper notes that for very small 2, segmentation and bit-packing overhead may outweigh benefits; optimal block size is hardware-dependent; and extensions such as parallelization, GPU adaptation, SIMD vectorization, and advanced wheel factorization are left as future work (Thirdhana, 13 Dec 2025).
The Combined Sieve for prime-gap search has different tradeoffs. Its memory footprint grows with the number of intervals, the storage of 3 residues, and the composite-flag arrays. The modular-equation solver 4 is algorithmically intricate, and performance saturates once the one-time residue-precomputation cost is fully amortized. The paper explicitly identifies better cache layout, improved prefetching, SIMD for the small-prime stage, and generalization to twin-prime and 5-tuple searches as natural next directions (Troisi, 2020).
The natural-language SIEVE-GEN depends on the underlying model already being able to use context effectively. The paper reports that on Retail, Llama 3.1 8B performs very poorly with full context and that SIEVE training is slightly worse in that setting. It also emphasizes that decomposition and verification quality are LLM-driven and therefore noisy, and that verification becomes expensive for very long contexts; in MTOB, verification is omitted entirely (Asawa et al., 2 Feb 2026).
Across all uses, SIEVE-GEN therefore denotes selective generation under resource constraints rather than unconstrained exhaustive expansion. In prime sieving, the constrained resource is cache and memory bandwidth; in prime-gap search, it is modular work across many intervals; in context distillation, it is sample efficiency and prompt budget. The common pattern is technically exacting: precompute reusable structure, decompose the working domain into small units, and apply generation or marking only where the local structure indicates that work is necessary.