AI

Plain-language AI notes, minus the vendor fog.

AI is neither magic nor a threat to your soul. It is math, data, plumbing, and choices. These notes explain the parts that actually matter, in words that survive contact with a real conversation.

Interactive

Walk the whole path, step by step.

The interactive guide lets you pick a persona and follow a request from human need to useful output, with the workflow map lighting up as you move.

Start the walkthrough

AI explainer

How AI Works

Modern AI systems are pattern engines trained on enormous amounts of examples. A language model does not “know” things the way a person knows them. It predicts useful next tokens based on patterns it learned during training, then follows the instructions and context it is given at runtime.

The practical version: a user asks a question, the system builds a prompt, the model generates a response, and surrounding controls decide what tools it can use, what data it can see, what policies it must obey, and what should be blocked or logged.

User requestPrompt + policyModel responseTools / retrievalReview + logging

The parts that matter

  • Model: the trained engine that generates, classifies, summarizes, reasons, or transforms content.
  • Prompt: the instructions, context, and user request passed into the model.
  • Context window: the amount of text or data the model can consider at one time.
  • System instructions: higher-priority rules that shape behavior.
  • Tools: external capabilities like search, code execution, databases, calendars, tickets, or APIs.
  • Guardrails: policy, filtering, validation, logging, and human review around the model.

The blunt truth: AI quality is not just “which model did you pick?” It is the whole system around it: data, instructions, retrieval, tools, evaluation, security, and accountability.

AI explainer

What Are Golden Sets?

A golden set is a small, carefully curated, human-validated evaluation dataset used as the trusted answer key for an AI system. It is the “we know what right looks like” set.

Think of it like this: here are the examples we absolutely know the correct behavior for. If the AI cannot do well on this, we do not trust it yet.

Golden set rule: do not treat random scraped examples as gold. A real golden set is reviewed, versioned, representative, and protected from training leakage.

What belongs in a golden set?

  • Input: prompt, question, log, alert, document, image, ticket, or API request.
  • Expected output: ideal answer, label, classification, score, or action.
  • Metadata: category, difficulty, source, risk level, version, and date.
  • Human judgment: review by people who understand the domain.
  • Pass/fail criteria: what counts as correct, incomplete, unsafe, hallucinated, or blocked.

For AI security

I would split golden sets into several lanes: prompt injection, benign security Q&A, malicious cyber intent, ambiguous intent, false positives, and enterprise policy behavior.

The golden set becomes the regression test suite. Every time the prompt, model, RAG pipeline, classifier, policy, or tool access changes, the golden set tells you whether the system got better, worse, or quietly broke something important.

AI explainer

Standard Model vs Custom-Tuned Model

A standard model is a general-purpose model trained to handle a broad range of tasks. It is useful out of the box, but it does not automatically understand your company, your tone, your workflows, your risk tolerance, or your exact definitions of good and bad behavior.

A custom-tuned model has been adapted for a narrower purpose. That might mean it speaks in your preferred format, recognizes your categories, follows your escalation rules, or performs better on a specific domain such as AI security, SecOps triage, code review, policy mapping, or prompt-injection detection.

Standard model

  • Broad general knowledge
  • Fast to adopt
  • Good for many tasks
  • Less aligned to local policy
  • More dependent on prompting and retrieval

Custom-tuned model

  • Narrower and more specialized
  • Better format consistency
  • Can learn domain labels and patterns
  • Requires curated data and evaluation
  • Can become brittle if trained badly

The honest answer is that tuning is not always the first move. Sometimes a strong base model plus good system prompts, RAG, tool design, and golden-set evaluation is better than rushing into fine-tuning with messy data.

AI explainer

What Is Used in Tuning a Model?

Tuning uses examples. Not vibes. Not wishes. Examples. The model needs to see the kind of input it will receive and the kind of output you want it to produce.

Common tuning materials

  • Instruction/response pairs: “when asked this, answer like that.”
  • Classification examples: inputs labeled as benign, malicious, prompt injection, policy violation, false positive, escalation required, and so on.
  • Preference data: two or more responses ranked by humans so the model can learn what “better” means.
  • Domain examples: security alerts, policies, tickets, code snippets, architecture notes, incident summaries, or red-team prompts.
  • Negative examples: what not to do, including unsafe answers, hallucinated claims, wrong severity, or overblocking.
  • Evaluation sets: held-out data used to test the model, not train it.

The part people mess up

You should not train on your final exam. Keep your golden set separate. If the model sees the exact answers during training, the score becomes theater. It looks smart because you leaked the test.

For security work, the data should include boring normal cases too. A model that screams “malicious” at every security question is not safe. It is just useless with confidence.

AI explainer

GGUF, Safetensors, RAG, and the Acronym Swamp

The AI world is full of file formats, serving layers, tuning methods, and retrieval tricks. The names sound worse than they are. Here is the useful map.

GGUF

A common model file format used heavily with llama.cpp and local inference tools. It is popular for quantized models that can run on consumer hardware.

Safetensors

A safer model weight format often used in the Hugging Face ecosystem. It avoids some risks of older pickle-based formats.

RAG

Retrieval-Augmented Generation. Instead of expecting the model to remember everything, the system retrieves relevant documents and gives them to the model as context.

SFT

Supervised Fine-Tuning. Training a model on curated input/output examples so it learns a desired task, style, structure, or behavior.

LoRA / QLoRA

Parameter-efficient tuning methods. They adapt a model without retraining every weight, making tuning cheaper and more practical.

Embedding

A numerical representation of text, code, images, or other data. Embeddings help search systems find meaning, not just matching words.

Vector database

A database optimized for similarity search over embeddings. Often used in RAG pipelines.

Quantization

Compressing model weights to use less memory and run faster, usually with some quality tradeoff.

For a practical system, these pieces work together: documents become embeddings, embeddings go into a vector store, RAG retrieves the right chunks, the prompt tells the model what to do with them, and the golden set tells you whether the whole contraption actually works.