---
title: 'E2M-ATQ: Asymmetric Ternary Quantizer'
url: https://www.emergentmind.com/topics/euclidean-to-manifold-asymmetric-ternary-quantizer-e2m-atq
type: topic
---

# E2M-ATQ: Asymmetric Ternary Quantizer

Euclidean-to-Manifold Asymmetric Ternary Quantizer (E2M-ATQ) is the ternarization core of TWLA, a post-training quantization framework for large language models that achieves 1.58-bit weight compression and 4-bit activation quantization while maintaining high accuracy. Within that framework, E2M-ATQ converts a full-precision weight matrix into an asymmetric ternary representation designed not merely to approximate weights in parameter space, but to minimize layer-output error on calibration data. Its defining features are a row-wise asymmetric parameterization, a two-stage optimization that moves from Euclidean weight fitting to calibration-induced manifold relocation, and a row-wise closed-form refinement once the ternary support is fixed [2606.13054].

## 1. Position within the TWLA pipeline

E2M-ATQ is the module that turns TWLA from rotated full-precision weights into true ternary weights. In the pipeline, it appears after KOTMS and before ILA-AMP. KOTMS first rotates each layer’s weights into a more ternary-friendly coordinate system and suppresses activation outliers through the shared orthogonal transform. E2M-ATQ then performs the actual ternarization of the rotated weights, producing the ternary codes and row-wise scale and shift parameters. ILA-AMP finally allocates activation bitwidths across layers using a budgeted, interaction-aware objective. In this sense, E2M-ATQ is the component that makes the W1.58 part of the W1.58A4 regime possible [2606.13054].

| Order | Module | Function |
|---|---|---|
| 1 | KOTMS | Rotates weights and suppresses activation outliers |
| 2 | E2M-ATQ | Produces ternary codes and row-wise scale/shift |
| 3 | ILA-AMP | Allocates activation bitwidths across layers |

The rationale for introducing E2M-ATQ follows from two limitations of naive ternary quantization. First, pretrained LLM weights are described as often unimodal and biased, so direct ternary projection incurs large approximation error. Second, weight-domain reconstruction error is not identical to layer-output error; for PTQ, preservation of the forward pass on calibration activations is the relevant criterion. E2M-ATQ addresses both issues by separating stable ternary-code discovery from calibration-aware continuous relocation.

## 2. Asymmetric ternary parameterization

E2M-ATQ uses an asymmetric ternary form because pretrained LLM weights often have non-zero row-wise means, making symmetric ternarization too restrictive. The quantized weight matrix is written as

$$
\bar{\mathbf{W}} = \boldsymbol{\mu}\,\mathbf{1}^{\top} + \mathrm{diag}(\boldsymbol{\alpha})\,\mathbf{T}, \qquad \mathbf{T}\in\{-1,0,1\}^{n\times m},
$$

where $\bar{\mathbf{W}}\in\mathbb{R}^{n\times m}$ is the quantized weight matrix, $\boldsymbol{\mu}\in\mathbb{R}^{n}$ is the row-wise shift, $\boldsymbol{\alpha}\in\mathbb{R}^{n}$ is the row-wise scale, $\mathbf{T}$ is the ternary codebook matrix, and $\mathbf{1}\in\mathbb{R}^{m}$ is the all-one vector [2606.13054].

The shift is initialized with the row mean,

$$
\boldsymbol{\mu}=\frac{1}{m}\sum_{j=1}^{m}\mathbf{W}_{:j}.
$$

For row $i$, the quantization levels therefore become

$$
-\alpha_i+\mu_i,\quad \mu_i,\quad +\alpha_i+\mu_i.
$$

This permits adaptation to biased weight distributions rather than forcing the codebook to be centered at zero. The construction also clarifies why the method is termed *asymmetric*: the three levels are translated by $\mu_i$, so their center need not coincide with the origin. A plausible implication is that this row-wise shift expands the class of weight distributions that can be matched without changing the ternary alphabet itself.

## 3. Euclidean warm-start and ternary-code stabilization

The first stage of E2M-ATQ minimizes Euclidean reconstruction error through the objective

$$
L_1(\boldsymbol{\mu}, \boldsymbol{\alpha}, \mathbf{T}) =
\left\|\mathbf{W} - \boldsymbol{\mu}\mathbf{1}^\top - \mathrm{diag}(\boldsymbol{\alpha})\,\mathbf{T} \right\|_F^2.
$$

This stage serves as a warm-start that identifies a stable ternary pattern in ordinary Frobenius geometry before any calibration-aware refinement is attempted [2606.13054].

Initialization uses standard TWN-style row-wise thresholding,

$$
T_{ij}= \begin{cases}
+1, & W_{ij}>\Delta_i,\\
0,  & |W_{ij}|\le \Delta_i,\\
-1, & W_{ij}<-\Delta_i,
\end{cases}
\qquad
\Delta_i \approx \frac{0.75}{m}\sum_{j=1}^{m}\left|W_{ij}\right|,
$$

together with the least-squares scale estimate

$$
\alpha_i =\arg\min_{\alpha}\ \left\|\mathbf{W}_{i,:}-\alpha\,\mathbf{T}_{i,:}\right\|_2^2
=\frac{\sum_{j=1}^{m}T_{ij}W_{ij}}{\sum_{j=1}^{m}|T_{ij}|}.
$$

The stage proceeds by coordinate-descent-like updates over the shift $\boldsymbol{\mu}$, the scale $\boldsymbol{\alpha}$, and the ternary codes $\mathbf{T}$. With residual $\mathbf{E}=\mathbf{W}-\bar{\mathbf{W}}$, residual-mean correction is applied as

$$
\boldsymbol{\mu} \leftarrow \boldsymbol{\mu} + \frac{1}{m}\mathbf{E}\mathbf{1}.
$$

For a single row, the objective is

$$
\mathcal{L}(\mu,\alpha,\mathbf{t}) = \big\|\mathbf{w}-\mu\mathbf{1}-\alpha\mathbf{t}\big\|_2^2,
$$

and the update order $\mu\rightarrow\alpha\rightarrow\mathbf{t}$ is proven to be monotone:

$$
\mathcal{L}^{\tau+1}\le \mathcal{L}^{\tau}, \qquad \forall \tau\ge 0.
$$

The significance of this stage is primarily algorithmic. It stabilizes the discrete ternary structure in Euclidean space, thereby avoiding an immediate and potentially unstable optimization of discrete and calibration-weighted variables simultaneously.

## 4. Manifold relocation under calibration-induced geometry

After the ternary pattern stabilizes, E2M-ATQ freezes it:

$$
\mathbf{T}=\mathbf{T}^{(0)}.
$$

The second stage then optimizes only $(\boldsymbol{\mu},\boldsymbol{\alpha})$ using calibration activations $\mathbf{X}$ and the layer-output objective

$$
L_2(\boldsymbol{\mu},\boldsymbol{\alpha};\mathbf{T}) =
\left\| \left( \mathbf{W} - \boldsymbol{\mu}\mathbf{1}^\top - \mathrm{diag}(\boldsymbol{\alpha})\,\mathbf{T} \right)\mathbf{X} \right\|_F^2.
$$

Introducing the activation second moment

$$
\mathbf{S}=\sum_b \mathbf{X}_b^\top\mathbf{X}_b \in \mathbb{R}^{m\times m},
$$

this can be rewritten as

$$
L_2(\boldsymbol{\mu},\boldsymbol{\alpha};\mathbf{T}) =
\mathrm{Tr}\!\left(\mathbf{E}\mathbf{S}\mathbf{E}^\top\right),
\qquad
\mathbf{E} = \mathbf{W} - \boldsymbol{\mu}\mathbf{1}^\top - \mathrm{diag}(\boldsymbol{\alpha})\,\mathbf{T}.
$$

This is the manifold-aware objective: $\mathbf{S}$ changes the geometry from ordinary Euclidean norm to a calibration-induced metric [2606.13054].

With $\mathbf{T}$ fixed, the feasible set becomes an affine stratum parameterized by the continuous variables $(\boldsymbol{\mu},\boldsymbol{\alpha})$. The relocation step is described as projecting $\mathbf{W}$ onto the affine constraint set induced by a fixed $\mathbf{T}$ and solving row-wise normal equations. For row $i$, the optimality conditions yield the $2\times2$ system

$$
\begin{bmatrix}
\mathbf{t}_i \mathbf{S}\mathbf{t}_i^\top & \mathbf{t}_i \mathbf{S}\mathbf{1} \\
\mathbf{1}^\top \mathbf{S}\mathbf{t}_i^\top & \mathbf{1}^\top \mathbf{S}\mathbf{1}
\end{bmatrix}
\begin{bmatrix}
\alpha_i \\
\mu_i
\end{bmatrix}
=
\begin{bmatrix}
\mathbf{t}_i \mathbf{S}\mathbf{w}_i^\top \\
\mathbf{1}^\top \mathbf{S}\mathbf{w}_i^\top
\end{bmatrix}.
$$

The row-wise solution has an exact closed form in the TWLA formulation, and the final quantized matrix is expressed as

$$
\bar{\mathbf{W}} = \boldsymbol{\mu}^{*}\mathbf{1}^\top + \mathrm{diag}(\boldsymbol{\alpha}^{*})\,\mathbf{T}^{(0)}.
$$

The expression “Euclidean-to-Manifold” refers precisely to this transition: first stabilize the discrete ternary stratum under Frobenius geometry, then relocate the continuous parameters on the geometry induced by calibration statistics.

## 5. Feasible-set structure, stabilization, and edge cases

E2M-ATQ treats the ternary codebook as creating a stratified feasible set. Once $\mathbf{T}$ is fixed, quantized weights are restricted to an affine set parameterized by $(\boldsymbol{\mu},\boldsymbol{\alpha})$. This is the basis for the “manifold” language in the method description. The geometry of that set is induced by the activation second moment $\mathbf{S}$ through the trace form $\mathrm{Tr}(\mathbf{E}\mathbf{S}\mathbf{E}^\top)$, so the relocation step weights directions according to how input structure affects layer outputs rather than according to raw Euclidean distance alone [2606.13054].

The appendix introduces practical stabilization rules. The moment matrix is regularized as

$$
\mathbf{S}\leftarrow \mathbf{S}+\varepsilon \mathbf{I}, \qquad \varepsilon>0.
$$

If the determinant of the $2\times2$ system is too small, the method falls back to the Euclidean warm-start values. The determinant is written as

$$
D_i = a_i c - b_i^2,
$$

with

$$
a_i=\mathbf{t}_i \mathbf{S}\mathbf{t}_i^\top,\quad
b_i=\mathbf{t}_i \mathbf{S}\mathbf{1},\quad
c=\mathbf{1}^\top \mathbf{S}\mathbf{1}.
$$

The degenerate all-zero ternary row is handled explicitly by

$$
\mu_i^{*}=\frac{\mathbf{1}^\top\mathbf{S}\mathbf{w}_i^\top}{\mathbf{1}^\top\mathbf{S}\mathbf{1}},
\qquad
\alpha_i^{*}=0.
$$

These design details indicate that E2M-ATQ is not only a conceptual reformulation of ternarization but also a numerically guarded procedure for PTQ settings in which calibration covariance structure may be ill-conditioned.

## 6. Relation to prior ternary methods and empirical interpretation

TWLA contrasts E2M-ATQ with prior ternarization approaches such as TWN-style methods and PT\(^2\)-LLM. TWN-style methods mostly rely on direct thresholding and least-squares scaling in Euclidean weight space. PT\(^2\)-LLM appears as a ternarization baseline for comparison. Traditional ternary methods are described as generally assuming a symmetric or near-symmetric weight distribution and as not explicitly accounting for row-wise bias or output-error calibration. By contrast, E2M-ATQ uses asymmetric ternary levels with row-wise shift $\mu_i$, optimizes on a calibration-induced metric rather than only weight-space error, and separates discrete-code stabilization from continuous relocation [2606.13054].

The method is also positioned carefully relative to the heavy-tailed activation problem. Strictly speaking, heavy-tailed behavior is primarily an activation problem in TWLA, and KOTMS is the module that addresses it. E2M-ATQ instead operates on the weight side by reducing layer-output distortion introduced by ternarization. This distinction addresses a common misunderstanding: E2M-ATQ is not the component responsible for suppressing activation outliers, even though it is important for end-to-end accuracy preservation.

Ablation results in TWLA attribute a material contribution to E2M-ATQ. E2M-ATQ alone improves over the no-module baseline. KOTMS alone also helps, but E2M-ATQ tends to give larger gains on the reported metrics. The combination E2M-ATQ + KOTMS performs best among the two-module combinations, while the full three-module system with ILA-AMP is required to recover strong accuracy under 4-bit activations. On LLaMA2-13B with 16-bit activations, moving from no module to E2M-ATQ alone is reported to drop C4 perplexity dramatically and improve MMLU. On Qwen3-14B, E2M-ATQ combined with KOTMS gives much better MMLU than either alone. Under 4-bit activations, E2M-ATQ is necessary but not sufficient.

Taken together, these results support a specific interpretation of E2M-ATQ. It is the mechanism that adapts ternary weight quantization to biased, unimodal pretrained LLM weights and to the calibration-induced structure of layer outputs. This suggests that its main contribution is not simply ternary compression in isolation, but a calibration-aware reparameterization and relocation strategy that makes ternary weights viable within the broader W1.58A4 TWLA design.

Source: https://www.emergentmind.com/topics/euclidean-to-manifold-asymmetric-ternary-quantizer-e2m-atq