Interactive Notebooks

All notebooks are self-contained and runnable on Google Colab (free GPU tier). Each cell installs DantinoX automatically — no local setup required.

At a glance

#

Notebook

Topic

Est. time (T4)

01

Quickstart

AR model, attention/FFN/norm variants, Generator

~10 min

02

Discrete Diffusion

Masked diffusion (LLaDA), block-wise generation, DualCache

~20 min

03

Continuous Flow-Matching

Rectified flow in T5 embedding space, CFG guidance

~25 min

04

Benchmarking & Profiling

FLOPs, latency, BenchmarkSuite, Visualizer

~15 min

05

LoRA Fine-Tuning

Adapters, rank ablation, merge, domain adaptation

~20 min

06

Paradigm Profiling

AR vs Discrete vs Continuous Flow-Matching — 2D + interactive 3D Plotly

10–40 min

07

Diffusion Cache Profiling

No Cache vs Prefix Cache vs Dual Cache (Fast-dLLM)

5–25 min

08

Retrievers & Embedder Training

SimCSE, contrastive fine-tuning, FAISS, LangChain, ChromaDB

~25 min

10

Generation Quality Comparison

Perplexity, distinct-n, rep-n, entropy — AR vs Discrete vs Continuous Flow-Matching

~25 min

11

Attention Head Visualization

Causal vs bidirectional heatmaps, head entropy, layer-depth analysis

~10 min

12

Custom Paradigm Tutorial

Build SemiAR from scratch, training, generation, registry

~20 min


  • 01 — Quickstart


    From zero to a trained AR model in under 10 minutes. Covers the Level-1 one-liner API (dx.fit, dx.quick_generate), Level-2 explicit Paradigm, attention/FFN/norm/positional-encoding variants, and Generator decoding strategies (greedy · top-k · nucleus · streaming).

    ~10 min  ·  GPU (T4)

    Open in Colab View on GitHub

  • 02 — Discrete Diffusion


    Train a masked-diffusion LM end-to-end. Covers Paradigm(ModelConfig(paradigm="discrete")), (1/t)-weighted loss, iterative unmasking with four decoding strategies, noise schedule comparison (linear · cosine · sqrt), and block-wise generation with optional DualCache.

    ~20 min  ·  GPU (T4)

    Open in Colab View on GitHub

  • 03 — Continuous Flow-Matching


    Train a continuous flow-matching model (following the ELF recipe) with rectified flow in T5 embedding space. Covers FlowMatchingTransformer, logit-normal time schedule, Euler ODE generation, CFG guidance scale ablation (w = 1.0 5.0), and model-size sweep (embed_dim=768 fixed, dim and num_blocks free).

    ~25 min  ·  GPU (T4)

    Open in Colab View on GitHub

  • 04 — Benchmarking & Profiling


    Measure FLOPs analytically with count_flops, wall-clock latency with LatencyTracker, and run a full BenchmarkSuite sweep over sequence lengths and batch sizes. Visualise results with Visualizer.

    ~15 min  ·  GPU (T4)

    Open in Colab View on GitHub

  • 05 — LoRA Fine-Tuning


    Fine-tune a pretrained DantinoX checkpoint with Low-Rank Adaptation. Covers use_lora=True, adapter initialisation, lora_targets (attention · ffn · all), rank ablation, and merge_lora() for zero-overhead inference. Demonstrates domain shift (Shakespeare → Bible).

    ~20 min  ·  GPU (T4)

    Open in Colab View on GitHub

  • 06 — Paradigm Profiling


    Profile AR, Discrete Diffusion, and Continuous Flow-Matching side-by-side across scale, batch, dtype, and diffusion-step sweeps. Produces five 2D matplotlib benchmark figures and six interactive 3D Plotly surfaces. Exposes a QUICK flag for fast (~10 min) vs. full (~40 min) runs.

    10–40 min  ·  GPU (T4 / A100)

    Open in Colab View on GitHub

  • 07 — Diffusion Cache Profiling


    Compare No Cache, Prefix Cache, and Dual Cache (Fast-dLLM) across all dantinox.profiling metrics: latency (mean/p50/p95/p99), throughput, FLOPs, energy (NVML), perplexity, and entropy. Proves caching is lossless. Exposes a QUICK flag.

    5–25 min  ·  GPU (T4 / A100)

    Open in Colab View on GitHub

  • 08 — Retrievers & Embedder Training


    Train dense retrievers with EmbedderParadigm using SimCSE (unsupervised, dropout-based) and supervised contrastive fine-tuning (dx.EmbedderTrainer). Covers dx.Embedder.from_run(), FAISS vector search, LangChain and ChromaDB drop-in integrations, and injecting pretrained AR/Discrete weights into an embedder head.

    ~25 min  ·  GPU (T4)

    Open in Colab View on GitHub

  • 10 — Generation Quality Comparison


    Objective comparison of AR, Discrete Diffusion, and Continuous Flow-Matching on the same corpus. Covers perplexity (held-out NLL), distinct-1/2 (diversity), rep-4 (repetition), and output entropy. Includes a qualitative side-by-side and a summary radar chart.

    ~25 min  ·  GPU (T4)

    Open in Colab View on GitHub

  • 11 — Attention Head Visualization


    Visualise per-layer, per-head attention patterns for AR (causal, lower-triangular) and Discrete Diffusion (bidirectional, full matrix) on the same reference sequence. Covers head-entropy analysis, layer-depth attention distance, and a side-by-side paradigm comparison.

    ~10 min  ·  GPU (T4)

    Open in Colab View on GitHub

  • 12 — Custom Paradigm Tutorial


    Build a SemiAR paradigm from scratch — decodes one block of tokens per step, left to right. Covers the Paradigm interface, masked-token training loss, streaming generation, block-size ablation (1 token/step → one-shot), and registry integration for dx.fit('semiar', ...).

    ~20 min  ·  GPU (T4)

    Open in Colab View on GitHub


Requirements

All notebooks install DantinoX from GitHub in the first cell:

pip install "dantinox[all] @ git+https://github.com/winstonsmith1897/DantinoX.git"

A free Colab T4 is sufficient for all notebooks. Notebooks 06 and 07 expose a QUICK flag — set QUICK = False for larger sweeps that benefit from an A100. Notebook 09 is reserved for a future RAG end-to-end demo.


Running locally

pip install "dantinox[all] @ git+https://github.com/winstonsmith1897/DantinoX.git" notebook
jupyter notebook docs/notebooks/

Or with JupyterLab:

pip install jupyterlab
jupyter lab docs/notebooks/