# Conflict-Free Replicated Data Types for Neural Network Model Merging: A Two-Layer Architecture Enabling CRDT-Compliant Model Merging Across 26 Strategies

Crypto.world

> Model merging combines the weights of independently fine-tuned neural networks into a single model without retraining. For this to work peer-to-peer across many participants with no central server…

**arXiv**: 2605.19373

**Published**: 2026-05-16

**Authors**: Ryan Gillespie

## AI summary

CRDT-Compliant Neural Network Model Merging: A Two-Layer Architecture

## Overview

**Research area:** Distributed systems and distributed machine learning — specifically conflict-free replicated data types (CRDTs) applied to neural network model merging.

**Technical level:** Advanced. The paper combines formal algebraic proofs (semilattices, join operations, convergence theorems) with large-scale empirical benchmarking on transformer language models. Readers need familiarity with CRDT theory and model-merging methods to follow the proofs, though the architecture itself is conceptually simple.

**Scope (one sentence):** The paper audits 26 neural network merge strategies against CRDT algebraic requirements, proves that their failure is structural, and presents a two-layer wrapper architecture (`CRDTMergeState`) that makes any deterministic merge strategy usable in a conflict-free, coordinator-free distributed setting.

## What This Paper Is About

Model merging combines the weights of independently fine-tuned neural networks into a single model without retraining. For this to work peer-to-peer across many participants with no central server, the merge operation must satisfy the three CRDT laws — commutativity, associativity, and idempotency — so that replicas converge regardless of message order or duplication. The authors show that all 26 merge strategies they tested fail at least one law, and then build a wrapper that restores those guarantees while leaving the underlying merge strategy unchanged.

## Key Contributions

1. **A systematic algebraic audit of 26 merge strategies**, revealing that associativity fails for 25 of the 26, together with Proposition 4 — a formal result showing that normalisation-based merges cannot satisfy the CRDT axioms simultaneously (with extended arguments for manifold-projecting and thresholding merges).
2. **The `CRDTMergeState` two-layer architecture**, which achieves CRDT compliance across all 26 evaluated strategies by separating state management (Layer 1, OR-Set semantics where merge is set union) from strategy execution (Layer 2, deterministic pure functions over a canonically ordered contribution set with randomness seeded from the Merkle root).
3. **Formal proofs of Strong Eventual Consistency** for arbitrary merge strategies (Theorem 8 on CRDT compliance, Lemma 12 on hashing/ordering/seeding determinism, Theorem 13 on convergence of resolved values, Corollary 14 on universal compliance), plus complexity bounds in Theorem 15.
4. **Three-tier empirical validation**: controlled 4 × 4 tensors (104/104 tests pass), production models up to 7.24 B parameters (208 strategy-level tests, 43,368 layer-level property checks, 312 strategy-level tests and 43,472 total layer-level evaluations when combined with Tier 1), and multi-node convergence with 100 nodes, 20 orderings, gossip and partition healing, with CRDT overhead below 0.5 ms.

## Main Findings

- **Zero of 26 strategies are CRDT-compliant as raw operations.** On controlled 4 × 4 float64 tensors (seed 42, tolerance 10⁻⁵), 21/26 are commutative, 14/26 idempotent, and only 1/26 (Task Arithmetic) is associative — and Task Arithmetic fails idempotency. Total system-level compliance: 0/26.
- **Associativity is the universal bottleneck.** 25/26 strategies fail associativity on controlled tensors, and 22–25 of 26 fail at production scale. Proposition 4 explains why: normalisation divides by a divisor that depends on the number of inputs, so left- and right-association normalise different intermediate values.
- **Concrete counterexamples are given for each failure class.** Weight averaging gives (a+b+2c)/4 versus (2a+b+c)/4 under the two associations. SLERP with vectors (1,0,0), (0,1,0), (0,0,1) at t = 0.5 yields ≈(0.500, 0.500, 0.707) versus ≈(0.707, 0.500, 0.500). A 20% TIES-style trim on (10, 1, 0.1), (0.1, 10, 1), (1, 0.1, 10) yields ≈(3.0, 2.75, 5.0) versus ≈(5.0, 3.0, 2.75).
- **The wrapper fixes everything: 26/26 strategies pass.** Phase 2 yields 26/26 strategies passing all four CRDT properties (commutativity, associativity, idempotency, 3-replica convergence) — 104/104 individual tests.
- **Production-scale compliance is empirical coincidence, not algebra.** At scale, 2–3 strategies newly pass associativity within floating-point tolerance (1/26 → 3/26 on GPT-2-XL; 1/26 → 4/26 on Mistral-7B). The `ada_merging` case is the proof: it passes associativity on 128 × 128 slices but fails on 512 × 512 slices of the same GPT-2-XL weight matrix. Compliance is resolution-dependent and fragile.
- **Multi-node convergence is bitwise exact.** 100 nodes each contributing a 512 × 512 tensor (262,144 parameters per contribution; 26,214,400 in aggregate) using SLERP converge to a bitwise-identical result across 20 random gossip orderings (max element-wise difference = 0), with average gossip time 492.8 ms and average resolve time ≈19.7 s. Splitting into 10 isolated partitions of 10 nodes each and then healing also converges to a single bitwise-identical result.
- **Convergence is strategy-independent.** All 26 strategies tested on 10 nodes with 64 × 64 tensors produce the same final hash on all 10 nodes.
- **Overhead is negligible.** `merge()` is sub-millisecond regardless of model size; `resolve()` CRDT overhead (sorting, Merkle root, seed derivation) is consistently below 0.5 ms; memory overhead is below 10 KB for 16 contributions. At k = 200 contributions, gossip requires 200 × 199 = 39,800 merge calls, each O(1) in tensor size.
- **Downstream performance is unchanged by construction.** Because Layer 2 applies the identical strategy to the identical ordered set with the identical seed, the wrapper introduces zero computational divergence; the authors verified the implementation matches this construction byte-for-byte for representative strategy–model pairs.

## Methodology in Plain English

The authors first took 26 existing merge strategies and ran each one on small 4 × 4 tensors, testing whether swapping the order of inputs (commutativity), regrouping the merge (associativity), or merging a model with itself (idempotency) changed the answer. They then wrote a mathematical argument explaining why these failures are not accidents but follow from the way merge strategies normalise their outputs.

The fix works by not applying CRDT rules to the tensors at all. Instead, Layer 1 is a simple set of contributions with add and remove tags — an OR-Set — where merging two replicas is just set union, which trivially obeys all three laws. Each contribution is identified by its SHA-256 hash. Layer 2 takes the resulting set, sorts it by hash so every replica sees the same order, derives a random seed from the Merkle root of that set so stochastic strategies behave identically everywhere, and runs the chosen merge strategy as a pure function.

For empirical validation they scaled up in three tiers. Tier 2 used GPT-2-XL (1.5 B parameters, 193 eligible 2D layers) with three fine-tunes (`instruct`, `domain`, `wiki`) and Mistral-7B-v0.1 (7.24 B parameters, 224 eligible 2D layers) with three fine-tunes (`instruct`, `hermes`, `zephyr`), all stored in float16 and cast to float64 for testing. To keep the cost manageable they tested a representative 128 × 128 slice per unique tensor shape, with 512 × 512 capped verification as a cross-check, and full-layer checks on the 10 largest weight matrices for 6 representative strategies. Tier 3 used a push-based all-pairs gossip protocol on 100 synthetic nodes, plus partition-healing and 2-to-50-node scalability runs. All experiments ran on a single NVIDIA A100-SXM4-80GB with PyTorch 2.10.0 and CUDA 12.8; the reference implementation is `crdt-merge` v0.9.4.

## Why This Matters

**Impact on research.** The paper reframes a practical engineering problem as an algebraic impossibility and then routes around it. It distinguishes *syntactic* convergence (which the architecture guarantees) from *strategy quality* (which the literature already covers), and it flags "approximate associativity" in high-dimensional weight spaces as an open question worth formal characterising. The cross-scale finding that empirical CRDT compliance is resolution-dependent is a methodological warning for anyone benchmarking merge properties.

**Real-world applications:**

- **Multi-institutional research consortia** merging fine-tunes across universities or labs where no participant wants to host a central aggregation server.
- **Decentralised or gossip-based federated learning**, where CRDT-Merge could serve as the aggregation step for training-side protocols.
- **Collaborative model development platforms** with add/retract semantics, where OR-Set "add-wins" behaviour preserves contributions unless explicitly withdrawn.
- **Adversarial or trust-minimised settings**, where the paper notes Byzantine fault tolerance is additionally required (discussed under limitation L4).

**Industry relevance.** Federated learning is the dominant distributed-aggregation framework, and it depends on a central coordinator — a single point of failure. This architecture offers coordinator-free state convergence with overhead under 0.5 ms and memory cost under 10 KB for 16 contributions, which is dwarfed by inference and fine-tuning costs. The `crdt-merge` v0.9.4 reference implementation makes it directly testable.

## Future Directions

- **Cross-hardware determinism.** All experiments ran on a single GPU type (A100-SXM4-80GB), so cross-architecture reproducibility (A100 vs H100 vs CPU) is untested. The proposed fallback — every replica broadcasts a 256-bit Merkle root of the resolved output, and on disagreement falls back to the lowest node ID — preserves SEC at the cost of one round but degrades Layer 2 from coordinator-free to coordinator-assisted.
- **Delta-state CRDTs and incremental resolution.** Full-state merge should be replaced with delta-state propagation for billion-parameter models; this is not yet implemented in the prototype. Because `resolve()` recomputes the merged model from the full set on every call (O(k·p)), the authors propose caching, hierarchical resolve, and incrementally updatable strategies such as weight averaging (O(p) per new contribution).
- **Tombstone garbage collection.** GC via causal stability analysis must be deferred until after `resolve()` has executed and its output disseminated. Tombstone accumulation rates have not been empirically evaluated; overhead is described as negligible for the consortium scenario (k < 100 contributions, infrequent removals).
- **A general characterisation of CRDT-compatible merge functions.** The authors explicitly present Proposition 4 as a structural observation rather than a comprehensive impossibility theorem, and call a full characterisation of which merge functions can satisfy all three axioms an open question — alongside a formal account of when "approximate associativity" emerges in high dimensions.
- **Downstream benchmark evaluation.** The paper defers a task-level benchmark (e.g., MMLU or HellaSwag) to follow-up work, noting it is orthogonal to the convergence guarantees.

## Target Audience

Distributed-systems researchers working on CRDTs and replication; machine-learning engineers building multi-party or peer-to-peer model-training pipelines; federated-learning practitioners concerned about coordinator dependence; and ML-systems engineers who need to reason about floating-point determinism across heterogeneous hardware. The paper assumes comfort with algebraic properties and merge-strategy terminology, so it is best suited to readers with graduate-level or equivalent background in either distributed systems or model merging.

## Authors’ abstract

All 26 neural network merge strategies we tested including weight averaging, SLERP, TIES, DARE, Fisher merging, and evolutionary approaches -- fail the algebraic properties (commutativity, associativity, idempotency) required for conflict-free distributed operation. We prove that this failure is structural: normalisation-based merges cannot simultaneously satisfy all three properties. To resolve this, we present a two-layer architecture -- CRDTMergeState -- that wraps any…

[The full abstract on arXiv](https://arxiv.org/abs/2605.19373)

[Read the original paper](https://arxiv.org/abs/2605.19373)

---

Canonical: https://crypto.world/paper/conflict-free-replicated-data-types-for-neural-network-model-merging-a-2605.19373
