Skip to content
mentoor

Topic 2 of 5 · 3 min read

Text and code generation models

Goal: Name tasks suited to a text or code model and the check each kind of output needs before use.

A text model, also called a large language model or LLM, writes the most likely next words based on patterns learned from huge amounts of text. Code models do the same with programming languages. ChatGPT, Claude, Gemini, Copilot and open-weight models such as Llama are all in this group.

Check yourself · 1 of 3

What is a large language model mainly doing when it writes an answer?

Choose one answer

Why it matters

Text and code are the most common uses of generative AI at work. Knowing what these models do well tells you when to use them. Knowing how they work tells you what to check.

What they do well

  1. Drafting. Emails, reports, outlines, product descriptions, first versions of anything written.
  2. Rewriting. Shorter, simpler, friendlier, in another language, in another tone.
  3. Summarising. Condensing text you paste in.
  4. Explaining. Describing a concept, a contract clause or an error message in plain words.
  5. Code help. Writing a small function, explaining unfamiliar code, suggesting a test. Tools such as GitHub Copilot and Cursor work inside the editor.

What to check

The model predicts likely words. It does not look facts up. So it can state something false in a calm, fluent voice. This is often called a hallucination.

  • Facts, names, numbers, quotes and links: confirm each one with a source you trust.
  • Summaries: compare them with the original for missing or added points.
  • Code: run it, read it and test it. Code that looks right can still fail on edge cases or use a function that does not exist.
  • Advice on health, law or money: treat it as a starting point and ask a qualified person.

Before and after

Before: You ask a chat assistant for three court cases that support your argument, and paste the list into your document.

Models have been known to invent case names that look real.

After: You ask for the legal ideas that may apply, then search a legal database for real cases yourself, and use only the cases you can open.

What goes wrong

  • People trust the confident tone. Tone is not evidence.
  • People paste private data, such as customer records or unreleased plans, into a public tool. Check your workplace rules first.
  • People use the model as a search engine. Some assistants can browse the web, but you should still open the sources they cite.
  • People accept code they do not understand. If you cannot explain it, you cannot maintain it.

A good rule: use a text model to produce a draft, and treat yourself as the editor who is responsible for the final version.

Examples

Right task, right check

Task: rewrite a rude email to sound calm. Check: read it and make sure the meaning is unchanged. Task: explain an error message. Check: try the fix in a safe place first. Task: list statistics for a report. Check: every number needs a source you opened.

A made-up function

A coding assistant calls parse_dates_fast() from a library. The function does not exist. The code looked normal. Running it is the only way to find out, which is why you always run what you accept.

Key points

  • Text and code models, also called large language models, write likely next words from patterns in training text.
  • They are strong at drafting, rewriting, summarising, explaining and small coding tasks.
  • They can state false facts fluently, so names, numbers, quotes and links need a source.
  • Code from a model should be read, run and tested before you rely on it.
  • You stay the editor and are responsible for what you publish or ship.

Common mistakes

  • Trusting a confident tone as proof.
  • Pasting private or customer data into a public tool.
  • Using a chat assistant as a source of facts without checking.
  • Accepting code you cannot explain.

Check yourself · 2 of 3

A chat assistant gives you a statistic with no source. What is the best next step?

Choose one answer

Check yourself · 3 of 3

Which task is the best fit for a text model?

Choose one answer

Practice items, not counted towards your mastery.

Start here