Modulo Hashing and Linear Expert Capacity in CCSLM
Modulo Hashing and Linear Expert Capacity in CCSLM
Treating expert selection in a CCSLM (Concatenated Context Selected Linear Mappings) as a modulo hash table turns one of the traditional headaches of Mixture-of-Experts (MoE) architectures into a potentially useful design feature. Instead of spending parameters, computation and training effort trying to prevent expert collisions, we accept deterministic collisions and allow the learning capacity of each linear matrix to resolve them.
1. Modulo Hashing as Zero-Cost Routing
In conventional Mixture-of-Experts architectures, a learned router scores inputs or tokens against a collection of experts. This introduces additional computation, routing parameters, load-balancing losses and the possibility of routing collapse.
Modulo hashing offers a remarkably simpler alternative. Given an index or key h(x), we select one of M linear matrices using:
The input is then directed to the corresponding matrix in the bank:
This routing mechanism is deterministic, parameter-free and computationally inexpensive.
In a concatenated or compositional linear system, this determinism has an additional advantage. The assignment structure is fixed or systematically determined. Rather than chasing a continually shifting distribution of inputs caused by a learned router, each linear expert receives a consistent stream of inputs and learns the transformations required by its particular bucket.
The routing mechanism does not need to learn where inputs should go. Learning takes place inside the linear experts themselves.
2. Why Collisions Aren't Bugs in a Linear Bank
In a conventional hash table, two distinct keys occupying the same slot create a collision that must be resolved to preserve the integrity of the lookup operation. A linear expert bank operates under a fundamentally different interpretation.
A collision simply means that multiple distinct input modes, features or tokens are directed to the same matrix Wk.
A linear matrix is not a discrete lookup entry. It is a continuous linear operator capable of representing multiple linear associations simultaneously. When two inputs collide, the matrix does not overwrite one association with another. Instead, it learns a transformation that accommodates the combined demands of those inputs.
The important question is whether those demands are compatible.
If colliding inputs occupy sufficiently distinct directions, subspaces or structurally compatible regions of representation space, a single matrix may accommodate them with relatively little interference. Multiple associations can coexist within the same linear transformation.
Thus, collisions in a linear expert bank need not be failures of routing. They can simply represent the sharing of linear transformation capacity.
3. Collision Resolution Through Learning Capacity
How successfully a linear expert accommodates collisions depends on the relationship between the number and nature of the competing associations and the representational capacity of the matrix.
Several factors influence this relationship.
Dimension and rank headroom
A matrix with greater dimensionality or effective rank has more degrees of freedom available to accommodate distinct input-output associations. Greater capacity may allow a linear expert to support more colliding input regimes without excessive interference.
Subspace orthogonality versus interference
Collisions become easier to accommodate when competing inputs occupy distinct or relatively independent directions in representation space. They become more difficult when different inputs demand incompatible transformations along the same dominant directions.
The geometry of the inputs and their desired transformations therefore plays an important role in determining the effective collision tolerance of a linear expert.
Gradient averaging as implicit regularisation
When several input regimes are routed to the same matrix, their gradient contributions accumulate during training.
Compatible associations can reinforce one another, while conflicting gradient contributions may partially cancel. In this sense, a shared matrix integrates the training signals associated with its various input regimes.
Over training, this accumulation may favor transformations that perform well across the combined distribution of inputs rather than over-specializing to any individual stream. The extent to which this is beneficial depends on the compatibility of the signals and the capacity of the matrix.
Concatenation and depth across layers
A collision occurring at one layer need not represent an irrecoverable loss of distinction. Subsequent linear stages or layers may transform, separate or further process the resulting representations.
As long as the information needed to distinguish the original input regimes has not been irreversibly discarded, downstream stages may help resolve distinctions that were not fully accommodated by an earlier expert.
This introduces an additional dimension of effective capacity: the ability of the overall composition to compensate for limitations at individual stages.
4. Where Modulo Hashing and Capacity Hit a Wall
Modulo hashing is simple, but its behavior is not without limitations.
Harmonic and stride aliasing
Inputs with periodic or structured indices may align unfavorably with the modulo operation. Token IDs, positional indices or regularly spaced input patterns may disproportionately populate particular buckets.
Using a prime number of experts, or mixing the input bits before applying the modulo operation, may help reduce accidental alignment with these structures.
Capacity saturation under increasing collision density
As more distinct functional regimes are assigned to a single matrix, the demands placed on its representational capacity increase.
Eventually, the matrix may be unable to accommodate the combined requirements of its inputs. Underfitting, interference or degraded performance may then emerge across the colliding regimes.
The relevant limit is not necessarily the number of colliding inputs alone, but the complexity and compatibility of the transformations they require relative to the matrix's capacity.
Hard versus supplementary routing
Modulo selection provides a crisp, deterministic routing mechanism. However, if certain buckets become overloaded or particular input regimes prove difficult to accommodate, supplementary mechanisms could be introduced without abandoning the underlying simplicity.
For example, a small shared residual pathway or an additional expert selected only when certain conditions are met could provide a mechanism analogous to open addressing or chaining in conventional hash tables.
Such mechanisms would be optional extensions rather than prerequisites for the basic architecture.
5. The Fundamental Trade-off
The appeal of modulo-based expert selection in CCSLM is that it exposes a remarkably clean trade-off between the number of experts, collision density and the learning capacity of each matrix.
Increasing the number of matrices M generally provides more buckets and potentially cleaner separation of input regimes. Increasing the dimensions or effective capacity of individual matrices may instead allow each expert to accommodate a greater number of colliding regimes.
Rather than treating collisions as a routing problem that must be eliminated, CCSLM allows them to become a question of linear representational capacity.
This shifts the architectural emphasis away from learning an increasingly elaborate routing mechanism and towards understanding how much useful structure a linear matrix can absorb, how competing associations interact geometrically, and how the composition of multiple linear stages can exploit that capacity.
The resulting architecture presents a potentially interesting alternative to conventional MoE design: deterministic selection, minimal routing overhead and a learning process concentrated directly on the linear transformations themselves.
Comments
Post a Comment