wikillm

Paper · 2026-10-16 · cs.AI, cs.LG

ToPA: Block-wise Toeplitz Adaptation for Expressive and Efficient Fine-Tuning

ToPA is a parameter-efficient fine-tuning method that adapts a frozen weight with a chain of block-wise Toeplitz matrices plus an identity residual, avoiding explicit low-rank or sparsity limits. Block structure shortens the chain and aids stability. Author-reported: best commonsense average (86.3 with LLaMA-3-8B) and wins on GSM8K and HumanEval at about 12.6M parameters.

Parameter-efficient fine-tuningLow-rank adaptation (LoRA and variants)Sparse fine-tuningStructured matrix parameterizationfine-tuningparameter-efficientstructured-matrices

arXivPDFCodeMarkdown16 min read

AI-compiled by claude-haiku-5-5 on 2026-11-21, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Fine-tuning a large model means changing its weights, but changing all of them is expensive. Common shortcuts restrict the change in one of two ways: LoRA forces the change to be a low-rank product, and OFT/BOFT force it to be a sparse, structured transformation. Both shortcuts leave performance behind full fine-tuning.

ToPA takes a different structure. A Toeplitz matrix is one where every diagonal holds a single repeated value, so it stores far fewer numbers than a full matrix while still being dense. ToPA splits such a matrix into a grid of smaller Toeplitz blocks, which gives each factor more numbers to work with. Several of these factors are multiplied together, and an identity matrix is added so the adapter starts from the original model.

The point is that the block layout lets the chain stay short, and short chains train more stably than long ones. The authors report that this gives a better accuracy-per-parameter trade-off than the low-rank and sparse baselines they test.

TL;DR

  • ToPA adapts a frozen linear layer W0 by W = W0 (∏ T_blk + I), where each T_blk is a block-wise Toeplitz matrix §3.3 eq. 8.
  • Block-wise Toeplitz factors keep the update dense and not restricted to a fixed rank or sparsity pattern §4.1.
  • Author-reported gains are small, over the strongest baseline in each setting. Examples: 86.3 vs 85.9 average on commonsense with LLaMA-3-8B, and +0.9 on GSM8K with LLaMA-3-8B tab. 1 tab. 2.
  • Only the LLaMA-3 commonsense and math/code runs have training scripts in the repository. GLUE, subject-driven generation and LLaMA-2 runs have no code here.
  • Relevant if you need a PEFT method with more capacity than LoRA at a similar budget and can afford the extra FFT work and training care described under Pitfalls.

Problem

Full fine-tuning updates every weight and is costly in memory and compute §1. Low-rank adapters (LoRA and its variants) bound the rank of the update, and they note that a task can have a low intrinsic dimension while its weight update still has high matrix rank. They measure the rank of full fine-tuning on LLaMA-2-7B at about 3758, against 16, 32 and 64 for LoRA §2.1 fig. 1.

Sparse orthogonal adapters (OFT, BOFT) fix the sparsity pattern before training. Each adapted output column is then confined to a subspace chosen in advance, and the authors report that the non-zero ratio of the adapter R falls to about 0.5% to 6.5% under tight budgets §2.2 fig. 1.

The authors assume that a method which is neither rank-limited nor pattern-limited, while keeping the parameter count low, should close this gap. The stated assumptions are the usual PEFT setting: a frozen pretrained weight, adapters on attention or projection matrices, and a tight parameter budget §2.2 app. E.3.

Method

ToPA builds on three ideas.

  1. Toeplitz factor. An n × n Toeplitz matrix is determined by a vector of 2n − 1 numbers, and its product with a vector can be computed with the FFT in O(n log n) §3.1 eq. 4 app. D.
  2. Block-wise Toeplitz factor. Split n into p equal blocks of size b = n/p. Each of the p × p sub-blocks is an independent Toeplitz matrix. The total number of parameters is p(2n − p), about p times that of one Toeplitz matrix. A chain of t such factors therefore has t · p(2n − p) parameters §3.3 eq. 7 app. C.
  3. Residual chain. The adapter is W = W0 (∏_{i=1}^{t} T_blk^i + I), with the identity as a residual §3.3 eq. 8. Shorter chains mean fewer factors in the gradient product of Prop. 1, which the authors link to stability §3.2 eq. 6.

The naive version, a plain Toeplitz chain W0 ∏ T_i with T_i initialised to the identity, trains unstably. In the authors' run with t = 16 on LLaMA-3-8B, gradient norm and loss fluctuate heavily and the run collapses §3.2 fig. 2.

Initialisation. The first factor is set to zero and the others are drawn from a normal distribution, so the product is zero and W = W0 at step 0 §3.4 eq. 9. The paper does not state the standard deviation σ.

Expressiveness. The authors prove a universal representability result for block-wise Toeplitz chains. The chain length needed is about ⌊n/(2p)⌋ + 1 generically, and at most about 2n/p + 5 always. They also show that some updates need O(n) ToPA parameters but O(n²) for LoRA and O(n log n) for OFT or BOFT §4.2. These are existence results, not a bound on what training reaches.

Rank. For a generic choice of factors, the update ΔW = W0 ∏ T_blk has the same rank as W0 with probability one §4.1 eq. 10. At initialisation the first factor is zero, so ΔW = 0 at step 0. The result is about generic parameters, not the starting point.

Pseudocode for the forward pass, reconstructed from the paper and the reference code. The code applies factors in a loop, so it is the reference for ordering:

Pseudocode
# ToPA forward for one adapted linear layer  [§3.3] [eq. 8]
# x: (B, n) input rows; W0: (m, n) frozen weight
# factors: list of t arrays, each (p, p, 2b - 1), with b = n / p

def topa_forward(x, W0, factors):
    # Run x through the chain of block-wise Toeplitz factors; the reference
    # code applies the highest-index factor first and index 0 last
    # [code: peft/tuners/topa/layer_block_toeplitz.py#L214-L217]
    h = x
    for T in factors_in_code_order(factors):
        h = block_toeplitz_apply(T, h)
    # Add the identity residual, then apply the frozen weight  [eq. 8]
    # [code: peft/tuners/topa/layer_block_toeplitz.py#L290]
    return (h + x) @ W0.T
Pseudocode
# Apply one block-wise Toeplitz factor to a batch of vectors  [app. D]
# T: (p, p, 2b - 1); x: (B, n) with n = p * b; output: (B, n)

def block_toeplitz_apply(T, x):
    # Split each row into p blocks of length b  [§3.3]
    blocks = reshape(x, (B, p, b))
    # Circular-embedding length: smallest power of two >= 2b - 1; the
    # kernel is [T[j, i][b-1:], zeros, T[j, i][:b-1]]
    # [code: peft/tuners/topa/layer_block_toeplitz.py#L163-L169]
    L = next_power_of_two(2 * b - 1)
    # Output block i sums, over input blocks j, the circular convolution
    # of the kernel T[j, i] with input block j, computed with the FFT
    # [app. D] [code: peft/tuners/topa/layer_block_toeplitz.py#L171-L186]
    out = sum_over_j(circular_conv(kernel(T[j, i]), blocks[:, j]))
    # Keep the first b samples of each output block
    # [code: peft/tuners/topa/layer_block_toeplitz.py#L184]
    return reshape(out[..., :b], (B, n))
Pseudocode
# Initialise the chain so that W = W0 at step 0  [§3.4] [eq. 9]
# Paper: first factor zero, others N(0, sigma^2); sigma is not stated.

def init_factors(t, p, n, sigma):
    factors = []
    for k in range(t):
        # Each factor holds p * p Toeplitz blocks of 2b - 1 numbers each
        # [§3.3] [app. C]
        if k == 0:
            factors.append(zeros(p, p, 2 * (n // p) - 1))
        else:
            # Reference code uses sigma = 0.02
            # [code: peft/tuners/topa/layer_block_toeplitz.py#L84-L90]
            factors.append(normal(0, sigma, (p, p, 2 * (n // p) - 1)))
    return factors

Parameter count. For a square n × n layer, a chain of t factors with p blocks per dimension has t · p(2n − p) parameters app. C. Per factor, p(2n − p) equals p² blocks times (2n/p − 1) numbers each, so the two forms agree. The reference code stores the same count as (in/b)² · (2b − 1) · t per adapted layer layer_block_toeplitz.py.

Computation. One block-wise product costs O(p² q log q) with q = n/p, which is O(p n log q), and a chain of t costs O(t p n log q) app. C. The paper reports no measured wall-clock time or memory. Its sections and the LaTeX source contain only these analytic costs.

Hyperparameters

Values as stated in the paper, with script or code values where the paper says "not stated". Where a value is derived from the scripts (for example effective batch size = per-device batch × accumulation × GPUs), the card says so.

SettingAdapted modulest, pLearning rateBatchEpochsScheduleWarm-upMax lengthSource
Commonsense, LLaMA-3-8Bquery, valuet=3, p=8 (block 512)3e-516 (derived: 1 × 4 × 4 GPUs)3not stated in paper; code: linear100 stepsnot stated in paper; code: 256§5.2 tab. 1 app. E.3 train_topa.sh
Commonsense, LLaMA-2-7Bquery, valuet=2, p=163e-5163not stated100 steps (E.3 covers commonsense)not stated§5.2 tab. 1 app. E.3
Math, LLaMA-3-8Bquery, valuet=3, p=8 (block 512)1e-432 (derived: 1 × 8 × 4 GPUs)1cosine (code)not stated in paper; code: 3% of stepsnot stated in paper; code: 512§5.3 tab. 2 app. E.3 train_topa.sh
Math and code, Qwen3-4Bquery, valuet=3, p=51e-4321cosinenot statednot stated§5.3 tab. 3 app. E.3
Subject-driven, Stable Diffusion v1.5query, key, value, output of U-Net attentiont=2, p=326e-51about 1,000 stepsnot statednot statednot stated§5.4 tab. 4 app. E.3
NLU, DeBERTaV3-basequery, key, value (per E.3)t=2, p=4per task, see table below32per tasknot statednot statedper task§5.5 tab. 5 app. E.3

GLUE per-task settings, DeBERTaV3-base app. E.3:

DatasetMNLISST-2CoLAQQPQNLIRTEMRPCSTS-B
Epochs81530155404025
Learning rate3e-41e-44e-41e-41e-42e-53e-48e-5
Max sequence length25612864320512320320128

Other settings from the paper and code:

  • Optimiser: AdamW for all tasks app. E.3. The code uses adamw_torch with weight decay 0 in all three scripts train_topa.py train_topa.sh.
  • Precision: bf16 in the commonsense and math scripts train_topa.sh.
  • Block size vs p: the code takes a block size b, not p. With n = 4096 and p = 8, b = 512 train_topa.sh.
  • Training subset: math uses the first 100,000 rows of the split (metamath:100000), not a random sample train_topa.py.
  • Not stated: the paper does not state seeds, dropout, Adam betas or epsilon, or the random-seed policy for the main tables.

Results

Author-reported. Setup: frozen pretrained backbone; adapter on the listed modules; the paper compares against LoRA, DoRA, PiSSA, HiRA, RidgeLoRA, OFT, BOFT and HRA §5.1 app. E.2. The paper says 21 NLP and CV datasets across 5 architectures; this count is consistent with §5.1 and app. E.1 (8 GLUE + 8 commonsense + 4 math/code + 1 DreamBooth). Each method's number of trainable parameters is listed beside it.

Commonsense reasoning, eight tasks, LLaMA-2-7B and LLaMA-3-8B §5.2 tab. 1

BackboneApproachTrainable paramsARC-cARC-eBoolQHellaSwagOBQAPIQASIQAWinoGrandeMean
LLaMA2-7BLoRA r=3216.8M71.585.470.584.678.681.180.178.578.8
LLaMA2-7BDoRA r=3217.0M71.285.670.784.878.281.379.578.478.7
LLaMA2-7BHiRA r=3216.8M69.885.970.686.579.482.279.379.879.2
LLaMA2-7BRidgeLoRA r=3217.0M71.587.071.287.379.883.581.182.680.5
LLaMA2-7BOFT b=6416.8M69.986.670.586.580.483.180.282.079.9
LLaMA2-7BBOFT m=2, b=3217.0M70.187.470.682.477.683.279.278.678.6
LLaMA2-7BHRA r=6416.8M68.885.569.980.676.481.878.182.077.9
LLaMA2-7BToPA t=2, p=1616.7M72.585.671.587.783.684.580.984.581.4
LLaMA3-8BLoRA r=3213.6M80.492.873.093.584.888.880.286.084.9
LLaMA3-8BDoRA r=3213.8M80.993.072.993.885.688.780.186.285.2
LLaMA3-8BHiRA r=3213.6M83.092.774.095.186.489.081.886.386.0
LLaMA3-8BRidgeLoRA r=3217.0M81.592.973.791.788.288.381.785.285.4
LLaMA3-8BOFT b=6416.9M82.193.274.694.387.488.581.685.685.9
LLaMA3-8BBOFT m=3, b=1612.8M80.591.872.993.584.688.681.284.884.7
LLaMA3-8BHRA r=6413.6M79.392.671.192.684.888.679.283.884.0
LLaMA3-8BToPA t=3, p=812.6M81.592.275.194.488.489.982.186.586.3

Columns are sorted alphabetically by task; the paper's order is in tab. 1.

Headline: ToPA has the top average for both backbones, 81.4 (LLaMA-2-7B) and 86.3 (LLaMA-3-8B), with the fewest or near-fewest parameters. The margin over the best baseline is 0.9 (LLaMA-2: RidgeLoRA 80.5) and 0.4 (LLaMA-3: OFT 85.9). The table gives one run per method, and the seed is not stated.

Math reasoning and code generation, LLaMA-3-8B §5.3 tab. 2

Method# ParamGSM8KMATHHumanEvalMBPP
LoRA r=3213.6M70.722.550.067.5
DoRA r=3213.8M71.122.751.266.9
PiSSA r=3213.6M72.123.050.065.1
HiRA r=3213.6M68.922.150.667.2
RidgeLoRA r=3216.9M69.821.748.265.9
OFT b=6417.0M73.822.945.166.1
BOFT m=3, b=1612.8M69.422.445.167.5
ToPA t=3, p=812.6M74.723.551.867.2

Math reasoning and code generation, Qwen3-4B §5.3 tab. 3

Method# ParamGSM8KMATHHumanEvalMBPP
LoRA r=165.9M82.647.069.571.2
DoRA r=165.9M83.246.668.972.2
PiSSA r=165.9M83.547.470.173.0
HiRA r=165.9M83.646.067.771.2
RidgeLoRA r=165.9M83.746.566.571.2
OFT b=326.1M83.847.669.573.8
BOFT m=2, b=166.1M83.147.867.774.6
ToPA t=3, p=55.5M84.348.273.273.5

Headline (LLaMA-3-8B): ToPA leads GSM8K (+0.9 over OFT, the best baseline at 73.8) and HumanEval (+0.6 over DoRA at 51.2). On MBPP it trails BOFT and LoRA (67.5) by 0.3. The paper calls the MBPP gap marginal §5.3.

Multi-seed check, LLaMA-3-8B, three seeds app. F (the table lists mean ± spread; the paper does not state whether the spread is a standard deviation):

Method# ParamGSM8KMATHHumanEvalMBPP
LoRA r=3213.6M70.5 ± 0.422.5 ± 0.350.2 ± 0.367.2 ± 0.3
DoRA r=3213.8M71.1 ± 0.322.8 ± 0.251.0 ± 0.367.0 ± 0.2
OFT b=6417.0M73.4 ± 0.322.9 ± 0.245.7 ± 0.566.5 ± 0.2
BOFT m=3, b=1612.8M69.4 ± 0.422.3 ± 0.345.5 ± 0.367.1 ± 0.2
ToPA t=3, p=812.6M74.9 ± 0.323.5 ± 0.251.6 ± 0.367.2 ± 0.3

Subject-driven generation, Stable Diffusion v1.5, DreamBooth §5.4 tab. 4 fig. 3

Method# ParamDINO ↑CLIP-I ↑CLIP-T ↑LPIPS ↑
LoRA r=6412.8M0.6540.7930.2300.743
DoRA r=6412.8M0.6540.7910.2310.740
PiSSA r=6412.8M0.6340.7820.2280.739
HiRA r=6412.8M0.6680.7940.2260.736
RidgeLoRA r=6412.8M0.6570.7910.2220.737
OFT b=6423.3M0.6530.7930.2250.735
BOFT m=2, b=3223.4M0.6640.7960.2250.734
ToPA t=2, p=3211.5M0.6760.7960.2340.740

The paper says ToPA is best on DINO, CLIP-I and CLIP-T and marginally behind LoRA on LPIPS (0.740 vs 0.743), which it reads as a small loss in sample diversity §5.4.

Natural language understanding, GLUE, DeBERTaV3-base §5.5 tab. 5

Method# ParamMNLISST-2CoLAQQPQNLIRTEMRPCSTS-BAvg
LoRA r=80.44M89.9294.7269.3191.6893.9984.4889.4691.1288.09
DoRA r=80.47M89.6794.5068.8691.5594.2385.9289.4691.5688.22
PiSSA r=80.44M89.9095.0768.5291.7893.9886.6489.2291.1188.28
HiRA r=80.44M90.2095.6469.8091.0893.2687.0089.2291.4588.46
RidgeLoRA r=80.47M89.7495.1868.8291.5793.9885.2088.9791.1288.07
OFT b=160.44M89.5594.3868.9791.2593.5684.4888.7391.2487.77
BOFT m=2, b=80.47M89.4694.2768.1291.3293.6385.2088.9790.9887.74
HRA r=160.44M90.2495.4170.8091.2493.7085.2089.7191.1188.43
ToPA t=2, p=40.44M90.1595.1870.8891.8594.0586.2889.9591.6888.75

The paper reports a gain of 0.29 on the average over the best baseline (HiRA, 88.46) and first or second place on eight tasks §5.5.

Scaling and ablations (LLaMA-3-8B, math, text only)

  • Scale vs LoRA: at matched budgets with t = 3 and p ∈ {2, 4, 8}, ToPA beats LoRA at r ∈ {8, 16, 32} on GSM8K and MATH §5.6 fig. 6. The values are only in the figure.
  • Block count p: with t = 3 fixed, accuracy rises with p ∈ {1, 2, 4, 8} on the three commonsense tasks the authors plot §5.7 fig. 4.
  • Chain length t: with p = 8 fixed, accuracy rises from t = 1 to t = 3. At t = 4 it drops slightly on OBQA and PIQA, which the authors attribute to optimisation instability §5.7 fig. 4.
  • Identity residual: the authors report that including the identity matrix improves results on every commonsense task, on each backbone §5.8 fig. 5.

Paper vs code

Repository: https://github.com/scongl/ToPA, commit 85c3c1feaead270ddb0ec9dc10f374aaef6443e8 (one commit, 2026-10-14). The paper does not link it. The owner is the personal account scongl, and the README's author list matches the paper's. The sole commit is by sicongli, the first author. The card treats the repository as official on that basis. Verify the attribution before relying on it. The repository has no LICENSE file, so no code is quoted here.

The paper's checklist says the complete codebase will be released if the paper is accepted [checklist.tex]. The repository here may therefore not be the final release, and its scope is narrower than the paper's experiments.

  • Notation p vs block_size. The paper uses p (blocks per dimension) §3.3. The code takes block_size = n/p config.py. The paper's p = 8 on a 4096-wide layer is block_size = 512 in the code train_topa.sh. Consistent, but easy to mix up.
  • Commonsense hyperparameters match. The paper's lr 3e-5, warm-up 100, 3 epochs, batch 16 app. E.3 are the script values train_topa.sh. The script's effective batch of 16 is 1 × 4 × 4 GPUs, derived from the script train_topa.sh train_topa.sh.
  • Math hyperparameters match. lr 1e-4, batch 32, one epoch, cosine app. E.3 match the script train_topa.sh. The script adds a 3% warm-up ratio train_topa.sh, which the paper does not state.
  • Code-generation data differs. The paper trains code generation on CodeFeedback §5.1. The script trains on sub-task python from a dataset directory named pissa-dataset train_topa.sh train_topa.sh. The repository does not map one to the other, so this cannot be checked.
  • Initialisation constant. The paper leaves σ open §3.4. The code sets it to 0.02 for every factor except factor 0 layer_block_toeplitz.py.
  • Default values differ between files. The PEFT config defaults to toep_r = 4, block_size = 128 config.py. The training script defaults to toep_r = 4, block_size = 64 train_topa.py. The shell scripts override both.
  • Eval decoding. The paper says HumanEval pass@1 is measured "across multiple samples" app. E.1. The code generates greedily: temperature 0, top-p 1, max 1024 new tokens gen_vllm.py. If you reproduce the table, use greedy decoding.
  • Single-run vs multi-seed numbers. The main math table reports GSM8K 74.7 for ToPA. The three-seed table reports 74.9 ± 0.3 app. F. The paper does not say which seed the main table uses.
  • Not in the repository. The GLUE, DreamBooth/Stable Diffusion, LLaMA-2 and Qwen runs have no scripts. The repository's peft package is a modified copy with ToPA added, and it pins peft==0.14.0 requirements.txt.
  • Untested paper claims. The paper states the expressiveness theorem with an O(n) construction and does not verify it in code. The code has no test for it.

Pitfalls

  • Ambiguous factor order. Eq. (8) writes the product ∏ T_blk^i without saying how it acts on a row or column vector. The code applies the highest-index factor first to each input row layer_block_toeplitz.py. Check the order numerically against the reference before porting; the two conventions give different functions for non-commuting factors.
  • The zero factor gives W = W0 at step 0. A zero factor makes the whole product zero. If you init every factor with noise, the adapter starts away from the pretrained model. The paper's "rank is preserved almost surely" result §4.1 concerns generic parameters, not step 0, where ΔW = 0.
  • Unstated σ and warm-up. Only the code's σ = 0.02 is known. Other values will change convergence, and the paper's Fig. 2 instability is for t = 16 only.
  • Truncation. The math run truncates to 512 tokens and the commonsense run to 256 train_topa.sh train_topa.sh. The paper does not state either limit. Longer examples lose their tails silently.
  • Training data subset. metamath:100000 takes the first 100,000 rows of the split, not a random sample train_topa.py. The paper says "a 100k subset" §5.1.
  • Loss masking. The code masks prompt tokens with -100 and appends EOS to targets train_topa.py train_topa.py. The paper does not state this. The Alpaca-style prompt template is also code-only train_topa.py.
  • FFT in fp32. Under bf16 weights the code runs the FFT in fp32 layer_block_toeplitz.py. If you cast the whole path to bf16, expect numerical differences.
  • Dense merge is costly. merge() builds a dense in × in matrix by pushing the identity through the chain layer_block_toeplitz.py, so memory scales with in². The scripts merge after training (--merge True) train_topa.py.
  • Unmerge is not implemented. unmerge() raises NotImplementedError layer_block_toeplitz.py. Once merged, an adapter cannot be removed.
  • No scaling. scale_layer and unscale_layer only warn and keep the scale at 1 layer_block_toeplitz.py. Adapter-strength tricks used with LoRA do not transfer.
  • Divisibility. in_features must be divisible by block_size, or construction raises an error layer_block_toeplitz.py. Any module you add must respect this.
  • Parameter totals. Both the paper and the code count one n × n factor per adapted layer, applied to the layer's input app. C layer_block_toeplitz.py. The 12.6M in the LLaMA-3-8B row is consistent with that: 2 modules × 32 layers × 3 factors × 65,472 numbers ≈ 12.57M [derived; the 32 layers and hidden size 4096 are model config values, not stated in the paper].
  • Cost is analytic only. The paper reports no measured runtime or memory. Budget the FFT overhead yourself. Its published cost is O(t p n log q) per layer app. C.
  • Non-square layers. The code applies R on the input side and sums with the input before the frozen weight, so it works for out ≠ in. The paper's cost analysis assumes square W0 app. C.
  • Statistics. The main tables are single-run. The multi-seed table covers only LLaMA-3-8B on math and code app. F. Gains on the commonsense and GLUE tables are below 1 point and may be within run-to-run noise.

Lineage

  • Builds on: LoRA (low-rank adapters) §2.1; OFT and BOFT (sparse orthogonal adapters) §2.2 app. B; the Toeplitz decomposition theorem, used for the expressiveness claim §3.1.
  • Compared against: LoRA, DoRA, PiSSA, HiRA, RidgeLoRA, OFT, BOFT and HRA §5.1 app. E.2.
  • Superseded by: not stated.

Source and license

Adapted from “ToPA: Block-wise Toeplitz Adaptation for Expressive and Efficient Fine-Tuning” by Sicong Li, Qianqian Xu, Zhiyong Yang, Zitai Wang, Longtao Huang, Xiaochun Cao, Qingming Huang (arXiv:2610.22883), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/scongl/ToPA at commit 85c3c1feaead (none (no LICENSE file in repository)). Any quoted code is shown under that license.