Book a free call

How AI Actually Works: 30 Facts Technical Leaders Should Know

Thirty grounded facts about how modern AI systems work, from training and inference to tokens, embeddings and agent architecture, for technical decision-makers.

Hertiv engineering teamReviewed by a senior engineer
7 min read
How AI Actually Works: 30 Facts Technical Leaders Should Know
On this page

Short answer

AI systems learn patterns from data rather than following hand-written rules, and large language models generate text one token at a time by predicting likely next tokens. Understanding tokens, training data, embeddings, context windows and evaluation separates sound engineering choices from expensive guesses.

What are the core facts about AI that matter for builders?

Most practical AI decisions rest on a small set of concepts: how models learn, how they generate output, and where they fail. The table below summarises common topics and why they matter.

Topic What it means Why it matters Where it shows up
Training Adjusting model weights on data to reduce prediction error Determines base capability Foundation models, fine-tuning
Inference Running a trained model to produce output Drives cost and latency Chatbots, agents, copilots
Tokens Subword units of text Pricing and context limits Prompt design, billing
Embeddings Dense vectors representing meaning Enables semantic search RAG, clustering
Context window Maximum tokens a model can attend to Limits document size Long-document tasks
Fine-tuning Further training on task data Shifts style and format Domain adaptation
RAG Retrieving external text at query time Grounds answers in your data Support, knowledge bases
Agents Model plus tools, planning and memory Automates multi-step work Operations, finance
Evaluation Measuring output quality Prevents silent failure Release gates
Guardrails Constraints on inputs and outputs Reduces risk Security, compliance

Each row is a design lever. Teams that treat them as one blurry "AI" box tend to overpay for inference or under-test outputs. Breaking the system into these parts makes trade-offs visible. Hertiv's AI consulting work often starts by mapping these levers to business goals.

Facts about how models learn and generate text

A model learns by adjusting internal weights to reduce error on examples, then generates text by predicting one token at a time. Everything else in this section follows from that loop.

1. Models learn patterns, not rules

Training minimises a loss function over data. The model does not store a rulebook; it encodes statistical regularities that generalise to new inputs.

2. Generation is sequential

At each step the model scores candidate next tokens and samples one. This is why output can drift over long passages; each token conditions on the ones before it.

3. Temperature changes sampling

Lower temperature makes output more deterministic; higher temperature increases variety. For extraction tasks, low temperature is usually safer.

4. Tokens are subword units

Common words are one token; rare words split into pieces. Token counts, not word counts, drive cost and context limits.

5. Context windows are finite

Everything the model "knows" at inference time must fit in the prompt and context. Long documents need chunking or retrieval.

6. Fine-tuning shifts behaviour

Fine-tuning is effective for format, tone and narrow tasks. It is a poor substitute for missing knowledge, which retrieval handles better.

7. Hallucination is structural

Because output is sampled from learned patterns, models can produce fluent text without grounding. Retrieval and citation reduce this but do not eliminate it. Hertiv's RAG work treats grounding as an engineering problem, not a prompt trick.

Facts about data, embeddings and retrieval

Retrieval and embeddings let a model work with your documents without retraining it. These facts explain why data preparation dominates most AI projects.

8. Data quality beats data volume

Noisy, duplicated or outdated documents produce poor retrieval and confusing answers. Cleaning and de-duplication usually return more value than swapping models.

9. Embeddings represent meaning as vectors

Text is mapped to vectors so similar meanings sit close together. This supports semantic search, clustering and recommendation.

10. Chunking shapes retrieval quality

Documents split too small lose context; split too large dilute relevance. Chunk size and overlap are tuning parameters, not constants.

11. RAG grounds answers in your sources

RAG retrieves relevant passages at query time and passes them to the model. It keeps knowledge current without retraining and makes citations possible.

12. Hybrid search often wins

Combining keyword search with vector search tends to outperform either alone, especially for product codes and names.

13. Metadata filters matter

Filtering by date, department or access level prevents irrelevant or unauthorised content from reaching the model.

14. Evaluation needs a golden set

A small set of representative questions with known good answers is the cheapest way to catch regressions. Build it before launch. For teams planning assistants, Hertiv's AI proof of concept typically includes this set.

Facts about agents, tools and automation

Agents combine a model with tools, planning and memory to complete multi-step tasks. Reliability depends more on engineering around the model than on the model itself.

15. Agents are loops

An agent observes, plans, calls a tool, reads the result and repeats. The loop needs a stopping condition and a budget.

16. Tool design is interface design

Clear function names, typed arguments and predictable errors make agents more reliable. Ambiguous tools cause most agent failures.

17. Memory is a separate system

Short-term context and long-term storage are different problems. Long-term memory needs retrieval, retention rules and access control.

18. Multi-agent systems add coordination cost

Splitting work across agents can help with specialisation but adds latency and failure modes. Start with one agent and clear tools.

19. Human approval is a feature

For finance, legal and HR workflows, a human checkpoint before irreversible actions is standard practice. Hertiv's agentic AI development work builds these checkpoints in by default.

20. Observability is not optional

Log prompts, tool calls, outputs and latency. Without traces, debugging an agent is guesswork.

21. Security applies to AI systems too

Prompt injection, data leakage and excessive permissions are real risks. Treat model input as untrusted, as in this AI security guide.

Facts about evaluation, cost and operations

AI systems fail differently from conventional software: outputs vary, and problems are often gradual. Operational facts below help teams run them responsibly.

22. Evaluation is continuous

Model updates, data changes and prompt edits all shift behaviour. Evaluation should run on every release, like tests.

23. Determinism is limited

Even at low temperature, outputs can vary across runs and providers. Design workflows that tolerate variation.

24. Cost is driven by tokens and calls

Prompt length, output length and number of calls set cost. Caching and shorter prompts often matter more than model choice.

25. Latency compounds in agents

Each tool call adds time. Streaming and parallel calls improve perceived speed.

26. Providers change under you

Model versions are retired or updated. Abstract provider calls behind an interface to keep switching practical.

27. Guardrails are layered

Input validation, output checks, allow-lists and rate limits work together. No single filter is sufficient.

28. Governance is a product requirement

Data retention, audit trails and access control need owners. Hertiv's AI governance practice treats these as deliverables, not afterthoughts.

29. Small models have a place

For classification, extraction and routing, smaller models can be cheaper and faster. Match the model to the task.

30. People need training too

Teams need guidance on when to trust output and how to report problems. Adoption fails more often from process gaps than model gaps.

How to prioritise what to learn and apply

Start with the facts that affect your next release, not the whole list. The sequence below keeps effort proportional to risk.

  1. Map the workflow. Identify where a model adds value: drafting, extraction, classification or retrieval.
  2. Build an evaluation set. Collect 30 to 100 representative cases with expected outputs before writing production code.
  3. Choose grounding before fine-tuning. If the task needs current or private knowledge, start with retrieval.
  4. Measure cost and latency early. Token counts and call volumes shape architecture more than model choice.
  5. Add guardrails and human checkpoints for irreversible actions, then instrument traces.

Example: a support team drafts replies for 200 tickets a day. If each ticket uses 1,500 input tokens and 300 output tokens, that is roughly 360,000 tokens per day in total. At a typical range of low single-digit dollars per million tokens, the daily model cost is a few dollars; the real cost is review time. Numbers here are hypothetical.

Common mistakes

Most failures come from skipping fundamentals rather than choosing the wrong model. The bullets below cover the patterns seen most often.

  • Treating the model as a database instead of adding retrieval.
  • Skipping an evaluation set and relying on demos.
  • Ignoring token counts until the bill arrives.
  • Giving agents broad permissions and no human checkpoint.
  • Fine-tuning to fix a data problem.
  • Logging nothing, then debugging from user screenshots.
  • Assuming outputs are deterministic across model versions.

A short review of these points before launch catches most avoidable incidents. For teams building customer-facing assistants, the AI agent development page covers the architecture in more detail.

Key takeaways

  • LLMs predict the next token; they do not look up facts or run reasoning steps unless prompted to.
  • Tokens are subword units, so cost, latency and context limits are measured in tokens, not words.
  • Embeddings turn text into vectors that support search, clustering and retrieval for RAG.
  • Training data quality and labelling drive model behaviour more than model size alone.
  • Agents add planning, tool calls and memory on top of a base model; reliability comes from guardrails and evaluation.
  • Evaluation sets and human review are the main defence against silent regressions in production.

Frequently asked questions

What is the difference between AI, machine learning and deep learning?

AI is the broad field of making machines perform tasks that normally need human intelligence. Machine learning is a subset where systems learn from data. Deep learning is a further subset using multi-layer neural networks, which underpin most modern language and vision models.

Do large language models actually understand text?

They model statistical relationships between tokens at scale, which produces useful behaviour on many tasks. Whether that counts as understanding is debated. For engineering purposes, treat output as a prediction that needs grounding and evaluation, not as a knowledge source.

How many tokens are in a page of text?

A rough guide is that one token is about four characters of English text, so a page of around 500 words is typically several hundred tokens. Exact counts vary by tokenizer and language, so measure with the provider's tokenizer for budgeting.

When should I fine-tune instead of using retrieval?

Fine-tune when you need consistent format, tone or a narrow task behaviour that prompting cannot achieve reliably. Use retrieval when the model needs current, private or citable knowledge. Many production systems combine both.

Are AI agents reliable enough for production?

Reliable agents are built with narrow scope, well-designed tools, clear stopping conditions, logging and human approval for consequential actions. Broad, unsupervised agents remain risky. Start with one workflow and expand as evaluation data accumulates.

What should we measure before scaling an AI feature?

Measure output quality on a fixed evaluation set, cost per request, latency, and the rate of human corrections or escalations. These four numbers tell you whether the feature is ready to expand and where to invest next.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning an AI feature and want a clear technical path? Talk to Hertiv.

A senior engineer replies within one business day. Or see our AI Consulting service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call