A well-tested, correct and useful library, but the KAN timing conclusion in Sec. 5 contradicts Fig. 4, the benchmarks cannot be rerun, and 5 of the 7 code listings fail against the released code.
Soundness
2/4
Presentation
2/4
Contribution
3/4
Confidence
4/5
✓ 8 confirmed✕ 8 discrepancy◐ 1 inconclusive○ 1 not checkable
Summary
The paper describes TorchCurves, a pure-PyTorch library whose core operation maps a batch of scalars of shape (B,C) to points on C vector-valued curves, giving an output of shape (B,C,D). Curves are expressed in a B-spline or Legendre basis, c(x)=∑iviBi. The operation is differentiable with respect to both the inputs and the coefficients. It is exposed at three levels: trainable curve modules, basis modules whose coefficients come from another network, and a functional API. Input maps (rational, arctan, clamp, non-negative variants) send unbounded features into the curve domain.
Section 3.2 illustrates continuous feature embeddings, Kolmogorov–Arnold networks (KANs) and a monotone functional regression (auction win probability). Section 4 describes the algorithms: a sparse Cox–de Boor recursion with a custom autograd backward for B-splines, Clenshaw recursion for Legendre series, and a test suite against SciPy/NumPy with gradcheck. Section 5 times CPU curve evaluation against SciPy/NumPy (Figs. 2–3) and KAN training steps against EfficientKAN (Fig. 4). It concludes that TorchCurves is slower at small scale and "in the ballpark or faster" at larger scale.
Strengths
Numerically correct core, verified independently
Sec. 4 (p.6); `functional/_bspline.py`, `tests/`
B-spline values match scipy.interpolate.BSpline to 3.8×10−16 (fp64) and 4.0×10− (fp32) over 200 random configurations. These include non-uniform and repeated knots and degrees 0–5. Legendre values match to / . All 14 s with respect to inputs and coefficients pass. The repository suite gives 163 passed, 0 failed (checks 04, 05).
Weaknesses
KAN timing conclusion contradicts Figure 4
major · Sec. 5, last paragraph (p.7) vs Fig. 4 (p.10)
Sec. 5 says torchcurves is "generally in the ballpark of EfficientKAN. Faster for larger batch sizes and higher dimensions, while slower otherwise." In Fig. 4 at K=8 on CPU every cell is ≥1, and the ratio grows with both B and W: : 1.0→1.4→3.2; : 3.6→8.4→8.8 for . Overall, 33/54 cells are slower, 10/54 more than 2× slower, and only 19/54 faster. Along the ratio increases in 10/18 slices (check 01). Our rerun reproduces this pattern (check 14), so the figure is right and the text is wrong. The real regime split is in : torchcurves wins for at large batch and loses, sometimes by close to an order of magnitude, for small . rewrite the conclusion around , and state the small- overhead explicitly, since is a common KAN setting.
Questions for the authors
How do the SciPy and NumPy baselines in Figs. 2–3 evaluate C curves: one call per curve, a Python loop, or a single batched call (e.g. a stacked coefficient array or design_matrix)? What dtype and timer were used? Our B-spline ratios were about 3× higher than Fig. 2 under per-curve calls.
Which KAN input width was benchmarked, 16 (text) or 32 (Fig. 4 caption), and how was K mapped to EfficientKAN's grid_size and spline_order?
Given that Fig. 4 shows torchcurves up to 8.8× slower at K=8, with the gap widening as B and grow, do you agree that the advantage is governed by rather than by batch size and width? Can the small- overhead be reduced?
Verification
We ran 18 checks with scripts under work/verify/: 8 confirmed, 8 discrepancies, 1 inconclusive and 1 not checkable. The library's numerical core holds up. Values match SciPy and NumPy to machine precision, all gradchecks pass, the monotone-spline property and the paper's auction model behave as claimed, and the repository test suite passes (163/163 non-skipped). The discrepancies sit in the text, not the code. The KAN conclusion in Sec. 5 contradicts Fig. 4. Five of seven listings fail against v0.3.4. The formulas for coefficient counts, non-zero basis functions and loop counts are off by one or two. The default input map and the 'not-a-knot' terminology are misstated, and the KAN architecture is given inconsistently. Fig. 4 itself reproduced qualitatively (8/8 cells on the same side of 1), and so did the Legendre part of Fig. 3. The B-spline part of Fig. 2 did not reach the 'faster at large scale' regime on our 2-core machine. The figures cannot be regenerated exactly because no benchmark harness is released. All 18 references exist; the issues found are bibliographic.
8Confirmed
8Discrepancy
1Inconclusive
1Not checkable
✕DiscrepancySec. 5 (p.7, last paragraph) vs Figure 4
Shtoff, Abboud, Stram, Somekh. Function Basis Encoding of Numerical Features in Factorization Machines. TMLR, 2024 (shtoff2024functionbasis)
Could not be verified automatically. The entry gives no DOI, arXiv id or OpenReview link. Crossref's best match is an unrelated paper ('Mystique…'), and the OpenReview API returned 403 (work/verify/18_ref_spotcheck.log). It is probably a real TMLR paper, but the reference should include a resolvable identifier. It is self-cited as the motivation for numerical-feature embeddings.
Kidger, P. torchcubicspline. Software, GitHub patrick-kidger/torchcubicspline, n.d. (kidgertorchcubicspline)
The repository exists (check 16), but the citation is dated 'n.d.' and pins no version or commit. The 'Accessed 9 November 2026' date is the only anchor.
Version 0.1.3 can be resolved only on PyPI. The GitHub repository has no matching tag (check 16). Minor.
Liu et al. KAN: Kolmogorov-Arnold Networks. ICLR 2025 (liu2025kan)
No issue with the citation itself: Crossref did not match it, but the ICLR 2025 proceedings page and PDF resolve (HTTP 200, title matches) and arXiv 2404.19756 exists. Separately, the paper's body text misspells it as 'Kolmogorov-Anrnold networks' (line 51).
Clenshaw, C. W. A note on the summation of Chebyshev series. Math. Comp. 9(51), 1955 (clenshaw1955note)
The paper exists, but the bibliography omits its DOI (10.1090/s0025-5718-1955-0071856-0). It is cited for the 'Clenshaw recursion' for Legendre polynomials, while the 1955 note treats Chebyshev series. Applying the recursion to Legendre series is a standard generalisation, so the support is indirect but acceptable.
Cox, M. G. The Numerical Evaluation of B-Splines. IMA J. Appl. Math. 10(2), 1972 (spline1972cox)
The work exists and supports the claim (DOI 10.1093/imamat/10.2.134). Cosmetic issue: the author name is printed as 'COX' in both the text and the bibliography.
Bezier 1968, 'How Renault uses numerical control for car body design and tooling' (bezier1968renault)
The work exists (SAE Technical Paper 680010, 1968), but the bibliography omits its DOI, 10.4271/680010. Minor.
De Boor, C. On calculating with B-splines. J. Approx. Theory, 1972 (spline1972deboor)
The work exists, but the bibliography omits its DOI, 10.1016/0021-9045(72)90080-9. Minor.
Suggestions
Rewrite the Sec. 5 KAN conclusion to match Fig. 4: torchcurves is faster at large K (≥32) and large batch, and up to about 9× slower at small K with a gap that widens with B and W. Add the explanation (sparse evaluation cost is independent of ).
Scope of this review
We reviewed the PDF, its LaTeX source and the released repository (torchcurves v0.3.4, HEAD 10094de). All checks ran on a CPU-only, 2-core container with torch 2.8 / Python 3.11, whereas the paper used a 4-core laptop with an RTX PRO 500 and PyTorch 2.15. GPU results (the GPU half of Fig. 4) and CUDA/XPU tests (40 skipped) could not be run. Timing reruns use our own harness, because none is released, and a reduced budget for the KAN runs. They test qualitative patterns, not the exact figure values. The Ubuntu and CUDA versions were not verified, and the TMLR self-citation could not be resolved automatically.
Clean, composable abstraction with three API levels
Sec. 3.1, Listings 1–4 (p.3–4)
The (B,C)→(B,C,D) contract is used uniformly by the trainable modules, the basis modules and the functional API. This covers both "coefficients are parameters" and "coefficients come from another network", and the second case is easy to get wrong when written by hand. After minimal fixes, every listing returns the documented shapes (check 06).
Sparse Cox–de Boor with a custom backward scales well in the number of coefficients
Sec. 4 (p.6); Fig. 4 (p.10)
Each point evaluates only degree+1 basis functions (check 08, library output width). As a result, the torchcurves KAN step time barely depends on the coefficient count K: 462 ms at K=8 vs 467 ms at K=64 for W=128,B=1024. EfficientKAN's dense basis grows from 84 ms to 1431 ms over the same range (check 14). This is a real, reproducible advantage at large K.
Non-trivial monotone regression example that is correct
Sec. 3.2, functional regression listing (p.5–6)
The auction win-probability model generates non-decreasing B-spline coefficients per sample (softplus increments plus cumsum). Over 64 random encodings × 8001 bids it produces a logit that is non-decreasing in the bid: the minimum finite difference is +8.8×10−9. The general property holds for 300 random monotone splines (check 10). The example shows coefficient-generating networks well.
The Legendre timing result and the large-K KAN result reproduce
Sec. 5, Figs. 3–4 (p.9–10)
An independent rerun of the CPU comparison puts Legendre ratios on the same side of 1 in 17/24 cells (geometric mean 0.61 vs paper 0.73), with torchcurves clearly faster at C=64 (check 03). The KAN rerun agrees with Fig. 4 on the side of 1 in 8/8 cells. At K=64 ours is 0.65/0.26/0.65/0.33 vs the paper's 0.74/0.32/0.84/0.46 (check 14).
Honest framing of efficiency goals in the abstract
Abstract; Sec. 4 (p.6); Sec. 5 (p.7)
The abstract and Sec. 4 state that the efficiency claim is "modest" and that the experiments show "where overhead is substantial". The timing grids span 81 cells per method over C, D, B and K, not a few chosen points.
W=32
W=128
B=64→1024
W
K
K≥32
K
Fix:
K
K
K≈8
Most code listings do not run against the released library
major · Sec. 3.1 Listings 1–4 (p.3–4); Sec. 3.2 listings (p.5–6)
Only 2 of 7 listings run verbatim (check 06). Problems: Listing 1 prints [4, 3, 2], not the commented [4, 5, 2]. Listing 2 has a missing comma (SyntaxError), a num_knots keyword that does not exist (it is knots_config and counts control points), and input_map='arctan' (invalid; 'real.arctan'). Listing 3 has an unclosed parenthesis, a nonexistent degree argument, and a wrong coefficient layout: the paper says (C,P,D) but the code expects (P,C,D). Listing 4 uses knot_config. In the embedding Net, the argument cat shadows torch.cat. The KAN listing passes a list to nn.Sequential. The monotone model requires exactly 10 encoder outputs, which is not stated. In a software paper the listings are the API documentation, so this misleads readers. Fix: generate the listings from tested files (e.g. doctest the LaTeX pycode blocks).
Benchmarks cannot be reproduced and are under-specified
major · Sec. 5 (p.7); Figs. 2–4 (p.8–10)
The repository has no harness for Figs. 2–4: no EfficientKAN reference, no timing code and no figure scripts (check 17). The paper does not say how SciPy/NumPy evaluate C curves (one call per curve or batched), which dtype was used, or which timer. It also does not give the mapping from K to EfficientKAN's grid_size. Each median uses only five timings and no spread is shown. Several slices are non-monotone in B (e.g. Legendre C=1,D=64,K=4: 2.1, 0.6, 1.7), which suggests noise (check 02). PyTorch uses 4 threads against serial NumPy/SciPy, which the text acknowledges. In our independent B-spline rerun (2 threads, one SciPy call per curve), ratios ranked like Fig. 2 (r=0.97) but were about 3× higher. Torchcurves never beat SciPy in the 24 cells we ran, because of roughly 300 µs of fixed per-call overhead (check 03). The B-spline claim "in the ballpark or faster for larger scales" therefore depends on setup details the paper does not report. Fix: release the scripts, report dtype, threads and the reference loop strategy, and use more repetitions with IQRs.
Mathematical statements about the bases are wrong (code is right)
minor · Sec. 3.1 after Listing 3 (p.4); Listing 3 comment (p.4); Sec. 4 (p.6)
Sec. 3.1 gives P=∣knots∣−degree+1. The correct identity, used by the library and SciPy, is P=∣knots∣−degree−1: the paper's formula holds in 0/19 cases and the correct one in 19/19 (check 07). Listing 3 says P=degree−1 for Legendre, but a degree-50 curve has 51 coefficients (check 07). Sec. 4 says "only degree+2" basis functions are non-zero at a point; the classical result and the code give degree+1 (check 08). A degree-5 spline takes 5 forward Cox–de Boor iterations, not "six" (check 09). Users who size coefficient-producing networks from these formulas will hit shape errors.
Incorrect descriptions of defaults, input maps and knots
minor · Sec. 3.1, Listing 2 and following paragraph (p.3); Listing 3 comment (p.4)
The text says arctan "is also the default", but the default input_map is 'real.rational' for all three modules (check 11). The comment "2 arctan(x) pi" should read π2arctanx. The comment "20 uniformly-spaced knots, with not-a-knot endpoints" is wrong twice (check 12). knots_config=20, degree=5 gives 26 knots in a clamped (open-uniform) vector. Not-a-knot is an interpolation end condition and does not describe this vector. The fact that nonneg.* maps clamp negative inputs to −1 without warning is not documented.
Inconsistent KAN benchmark specification
minor · Sec. 5 (p.7) vs Fig. 4 caption (p.10)
The text gives the architecture as [16,W,W,1], and the Fig. 4 caption as [32,W,W,1] (check 13), so the benchmarked configuration is ambiguous. The caption is correct that parameter counts differ. EfficientKAN has (K+2)/K times as many parameters (1.25× at K=8), which is far too small to explain the 8.8× slowdown.
Higher-order derivatives through B-splines are unsupported and undocumented
minor · Abstract; Sec. 1 (p.2); Sec. 4 (p.6); `functional/_bspline.py` (`_BSplineFunction`)
The paper claims differentiability "through both inputs and coefficients". First derivatives are correct, but create_graph=True through bspline_curves raises RuntimeError: ... functions with out=... arguments don't support automatic differentiation (check 05). This rules out gradient penalties, Hessians and physics-informed losses on spline inputs. Legendre curves support second derivatives correctly. The limitation should be stated, or the backward made double-differentiable.
Thin related work and no comparison with the closest differentiable baseline
minor · Sec. 1 (p.2); Sec. 2 (p.2)
Sec. 2 does not discuss the KAN variants that already parametrise edges with alternative bases (Chebyshev/Legendre/RBF KANs such as FastKAN), JAX spline libraries, or SciPy's vectorised BSpline.design_matrix. torch-bspline is cited as the nearest differentiable PyTorch B-spline package but is not benchmarked. The claim that "there seems to be no software library providing a common, composable interface" needs this context.
Unpolished manuscript
minor · Title; p.1 header and Fig. 1 caption; p.2; p.7
Is double-backward support for bspline_curves planned? Several use cases (gradient penalties, PINN-style losses, smoothness regularisers on the input) need it.
Can you release the benchmark scripts and raw timings (all repetitions) so that the per-cell variability behind the non-monotone slices in Figs. 2–3 can be assessed?
If the B-spline coefficient vector is non-decreasing, so is the function; the AuctionWinModel yields a P(win) logit that is non-decreasing in the bid.
Min finite difference -1.8e-15 (rounding level; tolerance -1e-12) over all random monotone splines; the control [0,3,-1,2,3] shows a decrease (-2.1e-4), so the test can detect violations. Paper's model head: min difference +8.8e-09 over all 64 x 8001 bids, and the logit at bid 0 equals the first coefficient. The paper-style call bids[None], coefficients[...,None] returns one logit per sample (shape (64,)). Note: monotone coefficients are sufficient, not necessary (e.g. [0,1,0.5,2,3] with cubic splines still gives a monotone function).
300 random non-decreasing coefficient vectors with plateaus (degrees 1-5, uniform and random non-uniform clamped knots) on a 20001-point grid; a non-monotone control; the paper's softplus/cumsum head with BSplineBasis(input_map='nonneg.arctan') for 64 random encodings over 8001 bids in [0, 1e4].
Input maps: arctan maps x to '2 arctan(x) pi' and 'is also the default'; real.rational is x/sqrt(1+x^2); nonneg maps handle non-negative inputs.
The default input_map is 'real.rational' for BSplineCurve, BSplineBasis and LegendreCurve; a default module is identical to real.rational (max diff 0.0) and differs from real.arctan (max diff 1.11). So the statement that arctan 'is also the default' is wrong. real.arctan equals (2/pi)arctan(x) exactly (diff 0.0); the comment '2 arctan(x) pi' read literally is off by up to 8.76 on [-50, 50], so it is presumably a typesetting slip for 2 arctan(x)/pi. real.rational equals x/sqrt(1+x^2) exactly (confirmed). nonneg maps send 0 to -1 and approach +1 as x grows; negative inputs are silently clamped to -1 (not documented in the paper).
inspect.signature defaults of the three modules; output equality of a default LegendreCurve vs explicit real.rational / real.arctan with shared weights; numeric comparison of the map formulas on x in [-50, 50].
Default knots are '20 uniformly-spaced knots, with not-a-knot endpoints' (Listing 2) / 'unif. spaced in [-1, 1] with not-a-knot conditions' (Listing 3).
BSplineCurve(knots_config=20, degree=5) has 26 knots, not 20: -1 and 1 each repeated degree+1=6 times, with 14 uniformly spaced interior knots (spacing uniform to 1.5e-7). This is a clamped (open-uniform) knot vector. 'Not-a-knot' is an end condition for interpolation that removes the knots at the 2nd and 2nd-to-last data sites (SciPy: x[1] and x[-2] are absent from the knot vector), so it does not describe the library's knots. The library documentation itself correctly says 'augmented knot vector with repeated boundary knots'. This is a terminology error in the paper, not a code error.
Printed the library's default knot vectors and boundary multiplicities; contrasted them with SciPy's not-a-knot interpolating spline knot vector (make_interp_spline, bc_type='not-a-knot').
KAN benchmark architecture is [16, W, W, 1] (text) / [32, W, W, 1] (Fig. 4 caption); 'architectures and parameter counts differ'.
The text (Sec. 5) says [16, W, W, 1] and the Figure 4 caption says [32, W, W, 1]; both appear once in the LaTeX source, so the benchmarked input width is ambiguous. Parameter counts: EfficientKAN has (K+2)/K times as many parameters (base_weight and spline_scaler per edge): 1.250x at K=8, 1.062x at K=32, 1.031x at K=64 (e.g. [16,128,128,1], K=8: 148,480 vs 185,600). The caption's admission is accurate, and the difference is too small to explain the 8.8x CPU slowdown at K=8. Note also that the mapping from K to EfficientKAN's grid_size (K = grid_size + spline_order) is not stated in the paper; our mapping is an assumption.
Searched main.tex for both architecture strings; instantiated the idiomatic torchcurves KAN (BSplineCurve+Sum, cubic, knots_config=K) and EfficientKAN KAN at the cited commit 7b6ce1c (grid_size=K-3, spline_order=3, i.e. K spline coefficients per edge) and counted trainable parameters for inputs 16/32, W in {32,64,128}, K in {8,32,64}.
Rerun of KAN training-step timing reproduces the Fig. 4 CPU pattern (e.g. K=8: 1.0, 3.2, 3.6, 8.8; K=64: 0.74, 0.32, 0.84, 0.46 for (W,B) = (32,64), (32,1024), (128,64), (128,1024)).
All 8 cells fall on the same side of 1 as the paper. K=8 ours 1.21, 2.10, 3.24, 5.50 vs paper 1.0, 3.2, 3.6, 8.8; K=64 ours 0.65, 0.26, 0.65, 0.33 vs paper 0.74, 0.32, 0.84, 0.46 (factor-of-1.6 agreement, expected given different hardware, threads and torch version). The rerun shows why: torchcurves step time is almost independent of K (W=128,B=1024: 462 ms at K=8 vs 467 ms at K=64), because the sparse Cox-de Boor evaluation touches only degree+1 coefficients, while EfficientKAN's dense basis scales with K (84 ms vs 1431 ms). The figure is therefore reproducible, and it reinforces check 01: at small K torchcurves falls further behind as W and B grow, the opposite of the Sec. 5 text.
Own timing on CPU (2 threads, float32, torch 2.8): idiomatic torchcurves KAN vs EfficientKAN (commit 7b6ce1c, grid_size=K-3), [16,W,W,1], Adam+MSE; reduced budget of 10 warm-up steps and 5x20 timed steps (paper: 50 and 5x100); median per-step time; 8 cells.
All stated versions exist and predate submission: NumPy 2.5.4 (first upload 2026-10-10), SciPy 1.18.1 (2026-08-21), PyTorch 2.15.0 (2026-10-28). The suspicion in the reading notes that these versions might not exist is unfounded. The OS ('Ubuntu 26.04.01') and CUDA version were not checked. The paper still does not report the dtype used for the CPU timings or the timing harness, and the package metadata requires torch>=2.9.
Queried PyPI JSON for numpy, scipy and torch; checked that the stated versions exist and were uploaded before the arXiv date (2026-11-10).
Cited software exists as described: EfficientKAN commit 7b6ce1c (Cao 2024), torchcubicspline (Kidger), torch-bspline v0.1.3 (Melchers and Cochran 2025).
All three repositories exist with matching descriptions. EfficientKAN commit 7b6ce1c87f18... exists (2024-07-03, 'Merge pull request #37'). torchcubicspline exists and constructs natural cubic interpolants, as the paper says. torch-bspline 0.1.3 is on PyPI, with Hugo Melchers and Jeffrey Cochran as authors (author_email field). The GitHub repo has no tags, so 'Version 0.1.3' is resolvable only via PyPI. Related-work characterisations match the repository descriptions.
GitHub REST API (repository metadata, commit lookup, tags, contributors) and PyPI JSON metadata.
The timing results of Figs. 2-4 can be regenerated from the released code.
The repository contains no harness for Figs. 2-4: no reference to EfficientKAN anywhere, SciPy/NumPy appear only in tests/_references.py (correctness references), and there is no timing code and no figure-generating script. The bundled benchmarks/ suite runs (24 passed) but only times torchcurves against itself. The exact figure values therefore cannot be regenerated; checks 03 and 14 are independent approximations. Releasing the benchmark scripts (including how the references loop over curves, dtype and thread settings) would make Sec. 5 reproducible.
Searched every text file in the released repository (incl. 8 example notebooks) for the baselines (efficient_kan, SciPy BSpline, NumPy legval), timing code and the figure file names; ran the bundled benchmarks/ pytest-benchmark suite on CPU.
All 18 bibliography entries exist and support the statements they are cited for (spot-check of load-bearing references).
All 18 references exist. The KAN ICLR 2025 proceedings page resolves with a matching title. The rational-map references describe whole-line rational / Legendre-rational methods, which is how they are used. Shtoff et al. 2024 (TMLR) could not be resolved automatically (OpenReview API returned 403, no identifier in the entry). Remaining issues are bibliographic: missing DOIs, an 'n.d.' software entry and a version that resolves only on PyPI.
tools/check_refs.py lookups on Crossref/arXiv, then targeted resolution of DOIs, the ICLR 2025 proceedings URL for KAN, and the rational-map references (Boyd 1987, Guo and Wang 2004, Wang and Guo 2004); OpenReview API for the TMLR self-citation.
KAN training: torchcurves is 'generally in the ballpark of EfficientKAN. Faster for larger batch sizes and higher dimensions, while slower otherwise.'
The figure does not support the text. Along width W the ratio INCREASES (torchcurves relatively slower) in 10/18 slices and decreases in only 4/18. At K=8 on CPU every cell is >=1 and the ratio grows with both B and W: W=32: 1.0->1.4->3.2, W=64: 1.2->3.3->6.5, W=128: 3.6->8.4->8.8 (B=64->256->1024); GPU K=8 W=128: 1.1->1.9->3.8. Geometric mean ratio CPU K=8 = 3.15, GPU K=8 = 1.54. Overall 33/54 cells slower, 10/54 more than 2x slower (max 8.8x), 19/54 faster. The 'faster for larger batch' statement holds only for K>=32 (e.g. GPU K=64 B=1024: 0.26-0.39, CPU K=64 B=1024: 0.30-0.46). 8.8x at the largest CPU configuration with K=8 is hard to call 'in the ballpark'.
Parsed all 54 ratio cells of Figure 4 from the vector PDF (pdftotext -layout) and tested monotonicity of the ratio in batch size B and hidden width W for every (device, K, W) / (device, K, B) slice; counted faster/slower cells.
CPU inference: torchcurves 'is slower for small number of curves or small batch sizes, and in the ballpark or faster for larger scales' than SciPy (B-spline, Fig. 2) and NumPy (Legendre, Fig. 3).
The qualitative summary matches the figures. B-splines: C=1,B=1 gmean ratio 18.8 (18-20x slower); cells with C>=16 and B>=256 gmean 0.91 (20/36 faster, max 2.0). Legendre: 'large' cells gmean 0.33, all 36 faster; C=1,B=1 gmean 1.53. Caveats the text omits: (i) B-spline C=64,B=1 is FASTER than SciPy in all 9 cells (0.50-0.56), contradicting 'slower for small batch sizes'; (ii) B-spline C=1 remains 1.3-4.1x slower even at B=2048 for D<=16; (iii) the ratio is non-monotone in B in 4/27 B-spline and 11/27 Legendre slices (e.g. Legendre C=1,D=64,K=4: 2.1, 0.6, 1.7; B-spline C=64,D=16,K=4: 0.51, 0.65, 1.5), which with only five timings per median suggests noise or cache/threading regime changes that are not discussed.
Parsed all 81+81 cells of Figures 2-3 from the vector PDFs; grouped by curve count C and batch B; geometric means; listed counterexamples and non-monotone slices.
Independent rerun of the CPU inference comparison reproduces the qualitative pattern of Figs. 2-3 (slower at small B/C, comparable or faster at large B/C).
Partly reproduced. B-spline ratios have the same ranking as Fig. 2 (Pearson r of log-ratios = 0.97) but are about 3x higher (geometric mean 6.07 vs 2.10 for the paper's values in the same cells): e.g. C=1,D=1,B=1,K=4 ours 83.9 vs paper 20; C=64,D=1,B=1 ours 1.56 vs paper 0.5; C=64,D=64,B=2048,K=64 ours 4.50 vs paper 1.0. In our setting torchcurves never beats SciPy for B-splines in any of the 24 cells; float32 brings the largest cell down to 1.33 (03b). The gap is dominated by a roughly 300 us fixed per-call overhead in torchcurves on this CPU vs 3.7 us for one SciPy call (03b). Legendre: same side of 1 in 17/24 cells, geometric mean 0.61 vs 0.73, and torchcurves is clearly faster at C=64 (0.04-0.39 for D=1); the low correlation (r=0.41) comes from cells such as C=1,D=64,B=2048,K=4 (ours 0.51 vs paper 1.7, likely a noisy paper value) and C=64,D=64,B=2048 (ours 1.1-2.2 vs 0.36-0.79). Different hardware, thread count and torch version mean the absolute ratios cannot confirm or refute the figures; the Legendre conclusion is robust, while the B-spline 'ballpark or faster at larger scales' did not hold on this machine. Values from both libraries agreed to <=1.3e-15 (B-spline) and <=5.8e-13 (Legendre). Absolute-time supplement: work/verify/03b_cpu_abs_times.py.
Own benchmark (scripts not released): torchcurves functional API vs scipy BSpline (cubic) / numpy legval, one reference call per curve (the paper does not say how C curves are handled), float64, median of 5 measurements, 24-cell subset of the grid; 2 threads on a 2-core container (paper: 4 performance cores). Supplement 03b gives absolute times, float32 and 1-thread runs.
Library values match SciPy splines and NumPy Legendre polynomials, in both float32 and float64.
Max scaled abs error: B-spline fp64 3.8e-16, fp32 4.0e-6; Legendre fp64 1.5e-14, fp32 7.7e-6 (tolerances 1e-12 / 1e-5). Repo suite: 163 passed, 40 skipped (all skips are CUDA/XPU-only cases; this machine is CPU-only), 0 failed under torch 2.8 / Python 3.11 (package metadata asks for torch>=2.9 and Python>=3.12, but the code runs on these). tests/conftest.py parametrises fp64 and fp32.
Independent comparison over 200 random B-spline configurations (degree 0-5, random non-uniform clamped knots incl. repeated interior knots, endpoints and knot values as inputs) vs scipy.interpolate.BSpline, and Legendre series with N=1..61 coefficients vs numpy legval; plus the repository test suite (tests/, notebooks excluded).
The curve operation is differentiable with respect to both inputs and coefficients; derivatives validated with PyTorch gradcheck.
All 14 gradchecks pass. Max scaled |d/du autograd - analytic|: B-spline <=3.3e-16, Legendre <=1.1e-14. Not claimed in the paper but relevant to users: B-spline curves do NOT support higher-order derivatives; torch.autograd.grad(..., create_graph=True) raises 'RuntimeError: sub(): functions with out=... arguments don't support automatic differentiation' (from the out= ops in cox_de_boor, called again inside the custom backward), so gradient penalties, Hessians and physics-informed losses through spline inputs fail. Legendre (plain autograd) gives correct second derivatives (-0.0954682090861294 vs -0.0954682090861265).
torch.autograd.gradcheck in float64 w.r.t. (inputs, coefficients) for bspline_curves (degrees 1-5, uniform and random non-uniform knots, points >=1e-3 from knots) and legendre_curves (N=11, 51, with and without checkpoint_segments=4); input derivatives compared with scipy BSpline.derivative() and numpy legder at 500 random points; double backward tested.
The code listings in Sec. 3 run against the released library and produce the stated outputs (e.g. Listing 1 prints torch.Size([4, 3]) -> torch.Size([4, 5, 2])).
Only 2/7 listings run verbatim. L1 runs but prints torch.Size([4, 3]) -> torch.Size([4, 3, 2]), not [4, 5, 2] as the comment states. L2: SyntaxError (missing comma after dim=5); with that fixed, BSplineCurve rejects num_knots (TypeError, the argument is knots_config and means number of control points: knots_config=20 gives 20 control points and 26 knots) and LegendreCurve rejects input_map='arctan' (ValueError: Unknown input_map; 'real.arctan' works). L3: SyntaxError (unclosed parenthesis); legendre_curves has no degree argument (TypeError), and with the documented (C, P, D) coefficient layout it fails (RuntimeError size mismatch): the code expects (P, C, D). L4: TypeError for knot_config (should be knots_config). L5 (Net): TypeError 'Tensor' object is not callable, because the argument cat shadows torch.cat. L6 (KAN): TypeError 'list is not a Module subclass' from nn.Sequential([...]); nn.Sequential(*[...]) works. L7 (AuctionWinModel) runs, but only if the encoder outputs exactly 10 values (default knots_config); this is not stated, and 16 outputs raise ValueError. After the minimal fixes every listing runs and returns the expected (B, C, D) shapes.
Executed all 7 listings verbatim from main.tex (pycode blocks) against torchcurves v0.3.4, supplying only the paper's undefined placeholders; then applied minimal fixes one at a time to locate every problem.
B-spline coefficient count 'P = |knots| - degree + 1'; Legendre 'We always have P = degree - 1'.
The paper's B-spline formula holds in 0/19 cases; the correct identity P = |knots| - degree - 1 (used by the library and SciPy) holds in 19/19 (e.g. P=20, degree=5: |knots|=26, paper formula gives 22). With 15 explicit knots and degree 3 the library infers P=11, not 13. Legendre: LegendreCurve(degree=50) has 51 coefficients (P = degree + 1), not 49; numpy confirms that 51 Legendre coefficients form a degree-50 polynomial. The code is right and the text is wrong; users sizing coefficient-producing networks from the paper would get shape errors.
Built knot vectors with the library for 19 (P, degree) combinations, compared |knots| with the standard identity and the paper's formula, and checked that SciPy BSpline accepts P coefficients; inferred P from an explicit 15-knot vector; inspected LegendreCurve coefficient shapes; numpy leg2poly for the degree of a 51-term series.
At any given point only degree+2 B-spline basis functions are non-zero.
For every degree 0-6 and both knot types the maximum number of non-zero basis functions at a point is degree+1 (e.g. cubic: 4, paper's formula gives 5), which is the classical result. The library's own cox_de_boor also returns exactly degree+1 values per point. The text is off by one; the implementation is correct.
SciPy BSpline.design_matrix at 10^4 random points plus every knot value, degrees 0-6, uniform clamped and random non-uniform knots; maximum number of non-zeros per row; width of torchcurves' cox_de_boor output.
'A spline of degree five does require six Python iterations to compute'; 'a polynomial of degree 50 will require 51 Python for-loop iterations'.
Legendre degree 50: 51 Clenshaw iterations (confirmed). B-spline degree 5: the forward Cox-de Boor loop runs 5 times (range(1, degree+1)), not 6; the backward pass adds 4 more (degree-1 basis for the derivative). This is a minor off-by-one in the description, with no effect on results.
sys.settrace/threading.settrace counting executions of the first loop-body line in _BSplineFunction.cox_de_boor and _clenshaw_segment during a forward pass (no grad) and a backward pass.
K
Make every listing an executed test, e.g. extract the pycode blocks and run them in CI, and fix the seven listings (shapes, knots_config, 'real.arctan', Legendre coefficient layout (P,C,D), torch.cat shadowing, nn.Sequential(*layers)).
Correct the formulas: P=∣knots∣−degree−1; Legendre P=degree+1; degree+1 non-zero basis functions; degree loop iterations. Describe the default knots as clamped (open-uniform), state that the default map is real.rational, and write the arctan map as π2arctanx.
Release the benchmark harness for Figs. 2–4. Report dtype, thread counts for all libraries, how the references handle multiple curves, and the K→grid_size mapping. Use more than five repetitions and show dispersion.
Add a single-threaded PyTorch run (or a multi-threaded or batched reference) to separate algorithmic overhead from parallelism. Also report the fixed per-call overhead, which dominates at small B and C.
Benchmark against torch-bspline, the closest differentiable PyTorch B-spline package, and discuss existing basis-function KAN variants in Sec. 2.
Document or remove the double-backward limitation of bspline_curves, which comes from out= operations inside the custom backward.
Clean the manuscript: title typo, template metadata, truncated caption and sentence, typos, and DOIs for the classical references (Cox 1972, de Boor 1972, Clenshaw 1955, Bézier 1968).