Papers
Topics
Authors
Recent
Search
2000 character limit reached

TwinWeaver: A Multifaceted Research Framework

Updated 4 July 2026
  • TwinWeaver is a versatile framework that, in oncology, serializes heterogeneous patient histories into text for LLM-based digital twin forecasting, as demonstrated on 93,054 patients.
  • It also enables designing electromagnetic twinning fields and twin-spacecraft architectures to achieve optical indistinguishability and optimized auroral measurements.
  • Beyond clinical and physical systems, TwinWeaver extends to algebraic constructions, poset twin-width algorithms, and twin supergravity formation through double-copy methods, uniting diverse methods under controlled equivalence.

Searching arXiv for the cited works and the primary "TwinWeaver" usage to ground the article in current records. TwinWeaver is a name used in several distinct technical senses across recent research. Its most explicit use is the open-source oncology framework described in "TwinWeaver: An LLM-Based Foundation Model Framework for Pan-Cancer Digital Twins," where heterogeneous longitudinal patient histories are serialized into text so that a single LLM can jointly forecast biomarkers and predict future clinical events (Makarov et al., 28 Jan 2026). In other work, the same label is used for a methodology centered on electromagnetic twinning fields that make distinct materials optically indistinguishable (McCaul et al., 2021), for a prospective twin-spacecraft auroral mission architecture informed by AuroraMag (Bhaskar et al., 2024), and for tool-like or conceptual workflows in multi-welded twin groups, twin quivers, poset twin-width, and twin supergravities (Nasser et al., 29 May 2026, Franco et al., 2023, Balabán et al., 2021, Anastasiou et al., 2016). This suggests a recurring emphasis on paired systems, controlled equivalence, and constructive mappings between distinct structures.

1. Pan-cancer digital twins and longitudinal clinical modeling

In its primary published sense, TwinWeaver is a general, open-source framework that turns heterogeneous, irregular oncology patient histories into text so that a single LLM can jointly forecast longitudinal biomarkers and predict future clinical events. The framework was used to build Genie Digital Twin on 93,054 patients across 20 cancer types from the Flatiron Health–Foundation Medicine Clinico-Genomic Database, with patient-level non-overlapping splits of 82,753 for training, 4,991 for validation, and 4,999 for testing. A single pan-cancer model was trained across all indications, and multiple splits per patient per line-of-therapy produced 2.49 million training samples. The base model was Llama 3.1 8B Instruct, fine-tuned for 1 epoch with AdamW at learning rate 10510^{-5}, context length 8,000 tokens, and 8 H100 GPUs, with approximately 7 days wall time and about 178 GPU hours (Makarov et al., 28 Jan 2026).

The core representation is textual serialization of the patient timeline. Static attributes include demographics, indication, and baseline diagnoses. Chronological visits are written at weekly resolution using relative time phrases such as “kk weeks later,” and may include labs, vitals, cancer-specific biomarkers, ECOG, therapies and lines-of-therapy, procedures, surgeries, progression, metastases, mortality, response, and genomics. Missingness is handled by omission: only observed values are written, and unmeasured future values remain missing in forecasting targets. Context management preserves the first visit and repeats the latest critical observations, including the latest labs of forecasted variables, latest genetics, and current therapy, to mitigate “lost in the middle.” Numeric values are rounded to two decimals, and blood lab targets undergo 3-sigma filtering during preprocessing.

TwinWeaver unifies two task families. For forecasting, the horizon is Δtforecast=13\Delta t_{\text{forecast}}=13 weeks, and the per-instance variable subset is sampled with probabilities proportional to log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v), where CvC_v is observation count and NRMSEv\mathrm{NRMSE}_v is copy-forward RMSE normalized by variable standard deviation. For landmark event prediction, the horizon is sampled uniformly from {1,,104}\{1,\dots,104\} weeks, with labels in {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}, and treatment switching together with dataset cutoff treated as censoring. Inference averages multiple generations for forecasts, with 3 generations per prompt used in real-world-data tests, while event risks are derived from length-normalized log-likelihoods over the three textual targets.

The reported performance is explicitly comparative. On real-world data, Genie Digital Twin achieved median MASE $0.867$ with IQR $0.186$, compared with kk0 for TiDE multivariate, with kk1. On the top 30 most volatile variables per indication, median MASE was kk2 with IQR kk3, compared with kk4 for TiDE multivariate, again with kk5. For risk stratification across survival, progression, and switching-therapy tasks, the average IPCW C-index was kk6, compared with kk7 for the strongest baseline, Random Survival Forest, and improvements were significant at adjusted kk8 in 11 of 12 evaluated time points. Metastasis prediction underperformed, with IPCW C-index kk9 versus Δtforecast=13\Delta t_{\text{forecast}}=130 over 3 indications, which the paper attributes to data scarcity. In out-of-distribution clinical trials, reported median MASE ranged from Δtforecast=13\Delta t_{\text{forecast}}=131 to Δtforecast=13\Delta t_{\text{forecast}}=132, and event prediction reached average IPCW C-index Δtforecast=13\Delta t_{\text{forecast}}=133 versus Δtforecast=13\Delta t_{\text{forecast}}=134 for the strongest baseline, while zero-shot GDT reached Δtforecast=13\Delta t_{\text{forecast}}=135.

An optional reasoning extension adds structured rationales. A teacher–student pipeline uses Qwen3.Next 80B-A3B to generate chain-of-thought conditioned on history and true outcomes, then fine-tunes GDT on the rationale corpus and aligns it with Group Relative Policy Optimization using 8 generations, learning rate Δtforecast=13\Delta t_{\text{forecast}}=136, 0.1 warmup, and 1 epoch. The rationale is organized with <thinking>, <prognosis_summary>, and <prediction> tags. The extension introduces a small forecasting trade-off, with MASE Δtforecast=13\Delta t_{\text{forecast}}=137 versus Δtforecast=13\Delta t_{\text{forecast}}=138, but provides explicit patient summaries, key predictive factors, mechanistic analysis, confounders, and prognosis summaries.

2. Optical indistinguishability and twinning fields

In nonlinear optics and driven many-body physics, TwinWeaver denotes a methodology for designing electromagnetic driving pulses—twinning fields—that force two distinct materials to produce identical chosen optical observables under the same drive. The formal criterion is optical indistinguishability: for systems Δtforecast=13\Delta t_{\text{forecast}}=139 and log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)0 driven by a common field log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)1, a prescribed observable log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)2 satisfies

log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)3

throughout a target window. The observables explicitly include time-domain polarization log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)4, current log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)5, spectra derived from Fourier transforms, reflectivity, and full nonlinear response functions. In the lattice setting, the construction is formulated with a Peierls phase log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)6 and a vector potential satisfying log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)7 (McCaul et al., 2021).

For generic 1D many-body tight-binding systems, the paper gives a closed-form twinning phase for current matching. If

log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)8

then equating log2(Cv×NRMSEv)\log_2(C_v \times \mathrm{NRMSE}_v)9 and CvC_v0 yields

CvC_v1

with

CvC_v2

Because CvC_v3 is real for valid states and CvC_v4 maps CvC_v5 to CvC_v6, the field always exists. A stated caveat is the trivial noninteracting ground-state case, in which CvC_v7 and CvC_v8.

The higher-dimensional situation is more restrictive. For current in CvC_v9 with identical lattice structures, each component obeys a 1D-like equation and one obtains closed-form twinning phases NRMSEv\mathrm{NRMSE}_v0 direction by direction. Realizability then depends on geometric consistency: the phases must reconstruct a single vector potential. The discussion highlights symmetry-based simplifications, such as polarization along a lattice vector in hexagonal lattices, which can force a perpendicular current component to vanish.

Uniqueness is addressed through a nonlinear “twinning Hamiltonian.” For finite-dimensional systems, uniqueness of the evolution and of NRMSEv\mathrm{NRMSE}_v1 follows from Picard–Lindelöf and Lipschitz arguments when

NRMSEv\mathrm{NRMSE}_v2

If these conditions fail, infinitely many solutions may exist; they coincide up to the first violation point, and the NRMSEv\mathrm{NRMSE}_v3 periodicity of the Peierls phase introduces a branch ambiguity resolved by continuity and bandwidth constraints.

The paper describes both a direct constructive scheme and an inverse optimization formulation. The direct route prepares initial states, optionally applies a pump to induce nonlinear behavior, computes the nearest-neighbor coherence NRMSEv\mathrm{NRMSE}_v4 at each step, updates NRMSEv\mathrm{NRMSE}_v5 from the closed form, reconstructs NRMSEv\mathrm{NRMSE}_v6 and NRMSEv\mathrm{NRMSE}_v7, and iterates until the current mismatch is within tolerance. When closed-form twinning is unavailable, the field is obtained by minimizing

NRMSEv\mathrm{NRMSE}_v8

with adjoint-based gradients and experimental constraints on amplitude, bandwidth, smoothness, and polarization.

Two model demonstrations are given. For the Fermi–Hubbard model, exact diagonalization with QuSpin was performed on a 1D ring of NRMSEv\mathrm{NRMSE}_v9 sites at half-filling, with {1,,104}\{1,\dots,104\}0, {1,,104}\{1,\dots,104\}1, {1,,104}\{1,\dots,104\}2, {1,,104}\{1,\dots,104\}3, and an initial single-cycle transform-limited sine-envelope pump of amplitude {1,,104}\{1,\dots,104\}4 and frequency {1,,104}\{1,\dots,104\}5. The resulting currents coincide within numerical precision over the target window. For graphene and hBN, on a hexagonal bipartite lattice with {1,,104}\{1,\dots,104\}6 and nearest-neighbor hopping {1,,104}\{1,\dots,104\}7, a pump and subsequent twinning field polarized along {1,,104}\{1,\dots,104\}8 produced identical {1,,104}\{1,\dots,104\}9 despite different onsite potentials. The paper interprets this as evidence that indistinguishability under strong driving can be a property of the drive rather than of equilibrium material identity.

3. Twin-spacecraft auroral mission architecture

In the space-weather context, the supplied literature does not introduce a separate published mission named TwinWeaver; instead, AuroraMag is presented as a source of orbit architecture, payload selection, asymmetry metrics, and operations for a twin-spacecraft auroral mission such as TwinWeaver. The baseline concept uses two identical small satellites operating simultaneously over the Northern and Southern Hemispheres to acquire conjugate views of the auroral ovals together with in situ measurements of particles, fields, and plasma temperature. The preferred architecture is a twin, polar, highly elliptical configuration with perigee {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}0 apogee {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}1, semimajor axis {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}2, eccentricity {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}3, inclination {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}4, and antipodal arguments of periapsis: {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}5 for the northern spacecraft and {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}6 for the southern spacecraft. The orbit period is approximately {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}7 minutes, and simulations indicate roughly {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}8 minutes of simultaneous auroral-latitude coverage above {occurred,not occurred,censored}\{\text{occurred}, \text{not occurred}, \text{censored}\}9 geographic latitude per orbit (Bhaskar et al., 2024).

The local-time geometry is centered on noon–midnight planes in order to optimize coupling diagnostics and coverage of both the dayside cusp and the nightside oval. The satellites travel in opposite directions while synchronized in orbital phase so as to equalize illumination and magnetic-local-time conditions. The paper notes that the abstract mentions a $0.867$0 elliptical orbit, whereas the science-return analysis and orbital simulations favor the $0.867$1 configuration because it maximizes auroral imaging geometry and vertical profiling while mitigating drag at perigee. An alternative circular sun-synchronous option at $0.867$2 and inclination about $0.867$3 would allow a single launch and natural plane precession, but with only about $0.867$4 minutes of simultaneous auroral-latitude coverage per orbit and without altitude profiling.

The payload complement is explicitly specified. Each spacecraft carries an auroral X-ray imager, an in situ particle detector, a magnetometer pair, and an electron temperature analyzer. The X-ray imager is a pinhole camera for soft X-ray bremsstrahlung and soft X-ray solar wind charge exchange, operating over approximately $0.867$5–$0.867$6 with spectral resolution around $0.867$7 at $0.867$8. Several field-of-view values are reported: a single-imager configuration around $0.867$9–$0.186$0, and up to about $0.186$1 using two pinhole detectors. MERiT-heritage particle measurements cover electrons from $0.186$2 to $0.186$3 with APDs, electrons near $0.186$4 with SSDs, and protons from about $0.186$5 to $0.186$6. The fluxgate magnetometers sample at 8 vectors per second, and the electron temperature analyzer uses a modified resonance probe with dual semi-circular electrodes.

AuroraMag also provides the quantitative asymmetry framework that a TwinWeaver-like mission would adopt. Hemispheric asymmetry is measured by

$0.186$7

where $0.186$8 and $0.186$9 denote northern and southern observables such as X-ray brightness, particle flux, or field-aligned current magnitude. Cross-correlation kk00 is computed over magnetic-local-time sectors to quantify lead–lag structure, and conjugate mapping is performed with magnetic field models such as Tsyganenko. Measurement-to-physics mappings include X-ray brightness inversion for precipitating electrons, current density from

kk01

Poynting flux from

kk02

and upstream solar-wind coupling proxies including kk03, the Newell coupling function, dynamic pressure kk04, and Alfvén speed with Mach number. The intended scientific focus is hemispherical asymmetry driven by IMF kk05, dipole tilt, seasonal illumination, conductance differences, cusp reconnection, and SEP access.

4. Algebraic and quiver-theoretic uses

A distinct mathematical use of the name appears in the theory of multi-welded twin groups. There, TwinWeaver is presented as the algebraic weave obtained by threading one involutive twin family through kk06 virtual families and welding their adjacent interactions. The resulting group kk07, introduced for kk08 and kk09, is generated by involutions kk10 and virtual Coxeter-type generators kk11 subject to twin involution relations, virtual Coxeter relations, mixed commutation, MR2-type relations, multi-virtual mixed relations, and welded relations. The paper proves that kk12 is a quotient of the universal welded braid group kk13, and that it admits natural quotient maps to and from the multi-virtual twin group, the welded twin group, and the corresponding universal virtual and welded braid-type groups. Its abelianization is kk14 for every kk15; for kk16, the commutator subgroup is perfect and the symmetric group kk17 is the smallest non-abelian finite quotient; and the paper classifies all non-trivial complex homogeneous 2-local representations, showing that only one family survives, while for kk18 all non-trivial complex homogeneous 3-local representations fall into four reducible and unfaithful families (Nasser et al., 29 May 2026).

A related but separate use appears in the theory of twin quivers for kk19 SCFTs engineered by webs of kk20 5-branes ending on 7-branes. In that setting, a twin quiver kk21 is a directed, potentially multi-graph whose nodes correspond to external 7-branes, whose ranks count terminating 5-branes, and whose arrows are determined by the intersection pairing

kk22

The superpotential is inherited from the untwisted bipartite graph of a brane tiling. The paper emphasizes two features that a tool-like TwinWeaver workflow would exploit: first, non-uniqueness across toric phases, which changes bidirectional arrows while preserving the antisymmetric pairing matrix; second, the appearance of quiver tails, connected subquivers attached to a core node and corresponding to subweb decompositions and roots of the Higgs branch in the extended Coulomb branch. The supplied constructive procedure starts from web or generalized toric polygon data, chooses a toric phase, untwists to a bipartite graph, merges nodes when white dots indicate grouped legs, reads off the quiver and superpotential, and then explores mutation, tail gluing, and tail decoupling through adjoint vevs. The paper’s interpretation is that phase multiplicity is not redundancy but a mechanism for covering distinct Higgs-branch roots via mutations that create different tails (Franco et al., 2023).

Taken together, these two usages present TwinWeaver as an operational language for controlled quotients, local representations, mutation, and the assembly of composite structures from elementary paired relations. The common mathematical emphasis is constructive equivalence rather than mere classification.

5. Poset twin-width and contraction-sequence construction

In algorithmic combinatorics, TwinWeaver is presented as a practical methodology for computing and exploiting twin-width on posets of bounded width. The starting point is a finite poset kk23 with width

kk24

The poset is encoded by the kk25-valued matrix kk26, where kk27 if kk28, kk29 if kk30, and kk31 otherwise. The paper distinguishes symmetric twin-width of the matrix encoding from a natural twin-width specialized to posets through contractions in red posets, and proves

kk32

where kk33 is natural twin-width and kk34 is symmetric twin-width (Balabán et al., 2021).

The main theorem is linear in poset width. If kk35, then natural twin-width is at most kk36 and symmetric twin-width is at most kk37, yielding the simpler corollary kk38. The dependence is asymptotically tight: there are width-kk39 posets with natural twin-width at least kk40. For width kk41, the worst-case natural twin-width is exactly kk42, and the paper gives a linear-time algorithm constructing a contraction sequence with red-degree at most kk43 throughout.

Two constructive algorithms are provided. For general width kk44, the algorithm takes as input a chain partition from Dilworth’s theorem and performs only neighborly contractions, meaning contractions of consecutive elements within the same chain. A chain diagram records black bars for covering relations across chains and red bars for current red edges. The analysis introduces a red potential over possible neighborly contractions and proves a bound on total red potential of at most kk45 when the current poset has kk46 vertices. A greedy step chooses a contraction minimizing red potential; while kk47, averaging guarantees a candidate with red potential at most kk48, and the domestic-plus-foreign red-edge accounting yields maximal red-degree below kk49. The total complexity is kk50.

For width kk51, a different method maintains a directed bar path that zig-zags between the two chains and ensures that all current red edges remain contained in an extended bar path. This invariant implies red-degree at most kk52 at all times. Using a chain-diagram representation with least-comparable pointers across the two chains, the algorithm runs in kk53 time.

The paper’s significance is both structural and algorithmic. It replaces an earlier indirect double-exponential translation from poset width to twin-width with direct constructive bounds and explicit contraction sequences. It also tightens the connection to FO model checking: because bounded twin-width classes admit FPT FO model checking, a poset of width kk54 inherits an algorithm running in time

kk55

with the contraction sequence produced by the TwinWeaver-style pipeline serving as the required certificate.

6. Twin supergravities from Yang–Mills squared

In high-energy theory, TwinWeaver is used as a conceptual description of constructing twin supergravities from left–right Yang–Mills factors. A twin pair consists of two supergravity theories kk56 with kk57, identical bosonic sectors, and different fermionic completions and supersymmetry realizations. The canonical example is the kk58 pair kk59: kk60 pure supergravity and the magic kk61 theory coupled to 15 vector multiplets. They share the scalar coset kk62 and the same bosonic couplings, but differ in gravitini and spin-kk63 content (Anastasiou et al., 2016).

The construction is framed through double copy. At tree level, KLT gives

kk64

while the BCJ formulation replaces color factors by a second set of kinematic numerators,

kk65

With matter in fundamental representations, the paper introduces a bi-fundamental scalar coupled to the familiar bi-adjoint scalar, and formulates a “sum of squares” rule under which adjointkk66adjoint and fundamentalkk67fundamental sectors double-copy separately, while cross-terms vanish.

The constructive TwinWeaver procedure begins from a parent theory

kk68

To obtain the big twin, one decomposes a left SYM multiplet, reduces supersymmetry, and replaces adjoint spinors by matter in a non-adjoint representation; the resulting product with the right adjoint multiplet yields a theory with kk69. To obtain the little twin, one similarly reduces the right factor, again converting adjoint spinors into matter representations, and forms

kk70

so that the bosonic sector remains unchanged while the supersymmetry and fermion content are reduced. In kk71, the procedure may also require chirality flips.

The paper identifies new double-copy-constructible theories, including matter-coupled kk72 twins in kk73 and kk74 twins in kk75. Explicit examples include the kk76 kk77 pair, the kk78 pair, the two-parameter kk79 family, the kk80 kk81 and kk82 pairs, and several chiral kk83 cases such as kk84, kk85, and kk86. The paper also shows that certain matter-coupled supergravities admit more than one Yang–Mills factorization, so the same bosonic supergravity may be produced by inequivalent left–right squarings.

Across these constructions, TwinWeaver functions as a unifying idea: a method for arranging left and right gauge-theory ingredients so that different supersymmetric completions share a single bosonic backbone. This same constructive emphasis links the supergravity usage to the optical, algebraic, combinatorial, and clinical senses of the term.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to TwinWeaver.