Skip to content
alfonsovegasol.comAsk Alfonso

Lab

Ask Alfonso: a language model I'm building from scratch.

Tokenizer, transformer, training loop and retrieval, all written by me and applied end-to-end. It will only answer from my real profile data, and say so when it doesn't know.

Status · In development

The chat will live here once the model is trained and evaluated. Until then, this page documents the build: architecture, training curves and honest limitations will be added as each phase ships.

Want to talk about it now? Get in touch →

How it works

  1. 01 · Data

    Knowledge base

    A corpus and Q&A set generated from the same data files that build this site.

  2. 02 · Tokenizer

    BPE from scratch

    Character-level first for intuition, then byte-pair-encoding merges.

  3. 03 · Model

    Decoder-only transformer

    Embeddings, causal multi-head self-attention, layer norm, MLP and residual connections.

    Builds on: Neural Networks and Deep Learning

  4. 04 · Training

    Pretrain, then fine-tune

    Adam, learning-rate warmup and decay, dropout, weight decay and early stopping.

    Builds on: Improving Deep Neural Networks

  5. 05 · Grounding

    TF-IDF retrieval

    Injects the relevant fact into the context and falls back to “I'm not sure” when confidence is low.

    Builds on: Can AI Spot a Lie?

  6. 06 · Evaluation

    Honest metrics

    Accuracy on held-out questions, hallucination rate, refusal correctness and latency.

    Builds on: Structuring Machine Learning Projects

Interactive tools

Each one lets you use something I built instead of reading about it.

  • Recruiter Match

    Planned

    Paste a job description and see my projects and skills ranked by fit, with the evidence for each requirement.

    Built on: TF-IDF from Can AI Spot a Lie?

  • Tokenizer Playground

    Planned

    Type any text and watch my BPE tokenizer split it into tokens, with their IDs.

    Built on: Ask Alfonso's tokenizer

  • Attention Visualizer

    Planned

    Ask a question and see which words each attention head focused on while answering.

    Built on: Ask Alfonso's attention weights

  • Fake-News Detector

    Planned

    Paste a headline and get a real/fake probability plus the words that pushed the prediction.

    Built on: Can AI Spot a Lie?

  • Draw a Digit

    Planned

    Draw a number and my MNIST network classifies it, showing the probability for each digit.

    Built on: Machine Learning Playground

  • Embedding Explorer

    Planned

    A 2D map of my projects and skills as embeddings; pick one to see its nearest neighbors.

    Built on: The recommender in Machine Learning Playground