EvaluatedApplications.AlgFormer 2.18.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package EvaluatedApplications.AlgFormer --version 2.18.0
                    
NuGet\Install-Package EvaluatedApplications.AlgFormer -Version 2.18.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EvaluatedApplications.AlgFormer" Version="2.18.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EvaluatedApplications.AlgFormer" Version="2.18.0" />
                    
Directory.Packages.props
<PackageReference Include="EvaluatedApplications.AlgFormer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EvaluatedApplications.AlgFormer --version 2.18.0
                    
#r "nuget: EvaluatedApplications.AlgFormer, 2.18.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EvaluatedApplications.AlgFormer@2.18.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EvaluatedApplications.AlgFormer&version=2.18.0
                    
Install as a Cake Addin
#tool nuget:?package=EvaluatedApplications.AlgFormer&version=2.18.0
                    
Install as a Cake Tool

AlgFormer

The reusable phasor-transformer engine from PrismFormer: define a model, train it data-parallel through an EvalApp pipeline, and run inference (predict / full logits / streaming generation with a KV cache). Ships two param-for-param comparable attention cores — AlgFormer (softmax dot-product) and HoloFormer (holographic bind/bundle/unbind resonance, O(T·d) with O(1)-per-token KV-serve) — plus the supporting pieces migrated from the full PrismFormer app: a subword tokenizer, the frozen production spec (PrismSpec), HoloShape capacity-law sizing, data-source adapters, and MQTT-based distributed/ swarm training. Pure double[] + SIMD, no external ML runtime or native dependency.

Features

  • Two param-for-param comparable attention cores: AlgFormer (softmax dot-product) and HoloFormer (holographic bind/bundle/unbind resonance).
  • Data-parallel training (PrismTrainer, resource-gated and adaptively tuned via EvalApp) for full epochs over your dataset, or train the model directly (TrainStep/TrainEpoch/Train).
  • Streaming inference with an incremental KV cache (NewCache/Prime/Step/Generate) for low-latency, close-to-constant-work-per-token generation.
  • Checkpoint save/load (Serialize/Deserialize, Save/Load) with format versioning, plus in-place growth: extend context length, attention shifts, or vocabulary on an already-trained model without retraining from scratch.
  • A capacity-law sizing module (HoloShape) for choosing model dimensions from measured, not guessed, tradeoffs.
  • A built-in subword tokenizer and several ready-made data-source adapters (raw corpus windows, prompt/answer pairs, source mixing).
  • Distributed/swarm training over MQTT, from full-model relay to data-free position-manifest relay.
  • Built-in gradient-check oracles so the training math itself is verified, not just assumed correct.
  • HoloFormer only, opt-in, default OFF: a per-layer Adam gate ("ADAM & EVE") that nudges a layer's update toward a codebook-derived target norm range instead of letting it drift unchecked. This is new and has not yet run a real training step — it does nothing unless you explicitly construct HoloFormer.EveOptions with a Mode and pass it to the gated Step/TrainEpochGated overloads.

Quick start

dotnet add package EvaluatedApplications.AlgFormer
using PrismFormer;

// Define a model — tokens are ints; bring your own tokenizer/encoding.
var model = new AlgFormer(vocab: 16, shifts: 4, layers: 2, maxContext: 6, dModel: 32, frozenPrefix: 0);

// Train — data is a list of (context tokens, target token) pairs.
var data = new List<(int[] Ctx, int Target)>
{
    (new[] { 1, 2, 3 }, 4),
    (new[] { 2, 3, 4 }, 5),
};
var trainer = new PrismTrainer(model);                 // data-parallel via EvalApp
double loss = trainer.TrainEpoch(data, batchSize: 2, lr: 5e-2, shuffleSeed: 1);

// Run inference.
var context = new[] { 1, 2, 3 };
int next        = model.Predict(context);                                    // argmax next token
double[] logits = model.LogitsFor(context);                                  // full logits
int[] generated = model.Generate(context, maxNewTokens: 5, temperature: 0.8, seed: 1);

Console.WriteLine($"loss={loss:F3} next={next} logits.Length={logits.Length} generated=[{string.Join(",", generated)}]");

Swapping in the holographic core is the same shape — construct a HoloFormer instead of an AlgFormer with matching dimensions, and train/serve it through the same API.

License

Proprietary — this package ships the compiled library only; source is not distributed. Every capability described above is free to use today; nothing in it is gated behind a tier or a license key. PrismTrainer's evalAppKey constructor parameter (and PrismEval.DefaultKey) exist but have no effect on which capabilities are available. See LICENSE. Copyright (c) 2026 Dongyang Stephen Chen, trading as Evaluated Applications. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on EvaluatedApplications.AlgFormer:

Package Downloads
EvaluatedApplications.AlgFormer.Gpu

ILGPU/CUDA acceleration for the AlgFormer package's HoloFormer model: GpuHoloTrainer runs batched GPU forward/backward training (CPU Adam by default, with an opt-in fused on-GPU Adam step) and GPU inference (Logits, StackIterLogits). GpuDevice auto-detects a CUDA device at startup and otherwise runs the SAME kernels on ILGPU's own CPU accelerator, so one build works with or without a CUDA card; genuinely over-length windows still run on the CPU HoloFormer directly. Every kernel is gradchecked against the CPU HoloFormer as its correctness oracle (float-close fp32, not bit-identical). Also ships an opt-in, default-OFF "ADAM & EVE" per-layer directional gradient gate layered on the fused on-GPU Adam step, live in production training (not an unused experiment) since 2026-09-24, plus preference (DPO) training on the GPU: per-sequence log-probabilities (SequenceLogProb) and a signed-weight all-positions training step (TrainBatchAllPosWeighted), at the same weight-tied depth the trainer trains at, with a frozen reference model (NewReference); exact bit-identical GPU page transforms for Phasor's Pleroma key band (PleromaPageTransform: Forward, Inverse, Dft over a 61-bit or sub-40-bit prime field, with an ILGPU CPU and a managed backend) and the Pleroma Cascade Newton pass (PleromaNewtonGpu); and a deprecated non-holo GpuModel/GpuTrainer twin for the older softmax-attention AlgFormer core. Add this package only if you want GPU acceleration; the core AlgFormer package stays dependency-free and AOT/trim-safe without it.

EvaluatedApplications.Prose

Grammar-driven synthetic corpus generator: mines nouns, verbs and adjectives and the syntax that joins them from real text with the rules of grammar, stores them in HoloDb, and recombines them into new grammatical sentences built only from words and pairings the text used, plus reading-comprehension Q&A pairs (single-sentence, multi-sentence passage, and two-turn). Rules-first (deterministic, zero-training) part-of-speech tagging, chunking and role assignment; mining fans out across cores through EvalApp (generation does too, opt-in); an optional mini-HoloFormer scorer re-ranks generated candidates by next-lemma likelihood once trained (POS tagging stays 100% rules-based).

EvaluatedApplications.Prism

Beta: A production standard for AlgFormer/HoloFormer models: an append-only lineage journal that answers "what was true at this point in training" without ever re-deriving it from current state, a confidence-gated decode policy (resonance-floor or nucleus sampling, with a degeneracy guard), and a growth surface that grows a model's context, layers, shifts, or vocabulary correctly by construction while stamping the journal automatically. For teams running AlgFormer/HoloFormer models in production who want checkpoint lineage and decode behaviour to stay correct through every growth step, not re-derived from whatever is live at the time.

EvaluatedApplications.EvalApp.Neural

An always-learning neural concurrency tuner for EvalApp. A small holographic policy model (HoloFormer, d48/L2/K2/shifts8) replaces the built-in heuristic on your app's resource gates and keeps learning from its own decisions, so it re-converges when the best concurrency moves. Ships with a warm-start model, makes at most one decision per 25 ms, and keeps learning in production. Opt in with .WithNeuralTuning(), or pass in a model you own with .WithNeuralTuning(model).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1 114 11/10/2026
4.0.0 90 11/9/2026
3.7.0 100 11/9/2026
3.4.0 116 11/3/2026
3.3.0 185 10/8/2026
3.2.0 124 10/6/2026
3.1.0 159 10/3/2026
3.0.0 160 10/3/2026
2.20.2 192 10/3/2026
2.20.1 160 10/3/2026
2.20.0 174 10/2/2026
2.19.1 182 10/2/2026
2.19.0 114 9/25/2026
2.18.0 126 9/24/2026
2.17.0 123 9/24/2026
2.16.0 123 9/24/2026
2.15.0 143 9/23/2026
2.14.0 126 9/23/2026
2.13.0 112 9/23/2026
2.12.2 117 9/22/2026
Loading failed