Units 6 and 7. Generative artificial intelligence: foundations and applications
- Explain what generative AI is and how language models produce text.
- Know its innovative applications, its technical challenges and open lines of research.
- Recognise its responsible uses for study and its limits, especially hallucinations.
- Verify the information and references that an AI produces.
Required reading
Walters, W. H.; Wilder, E. I. (2023). Fabrication and errors in the bibliographic citations generated by ChatGPT. Scientific Reports, 13, 14045.
Further reading
The generative AI block covers units 6 to 9 of the syllabus. This chapter covers foundations, applications and technical challenges (units 6 and 7); the next one covers ethics, authorship and regulation (units 8 and 9).
1. What generative AI is
Generative artificial intelligence produces new content (text, images, audio, code) from patterns learned from large amounts of data. Conversational assistants are based on language models: systems trained on huge collections of texts to predict the most likely word (in fact, word fragment) that follows a given text. By repeating that prediction again and again, the model writes fluent answers.
Three important consequences follow:
- The model produces what is plausible, not necessarily what is true. Bender et al. (2021) critically called them “stochastic parrots”: they combine linguistic forms without their own access to meaning or facts.
- What it knows depends on its training data: it may not know recent facts and may reproduce the biases in those data.
- How you ask matters: a clear prompt, with context, goal and format, gives better results.
Some systems combine the model with a search engine or a document collection and answer from what they retrieve (retrieval-augmented generation). This improves currency and makes it possible to link sources, but it does not eliminate errors: you must check that the source says what the system claims.
2. Innovative applications and technical challenges
Generative AI is already used to draft and translate texts, summarise documents, write and review code, create images, audio and video, support customer service with conversational assistants and help search for and organise information. In information and documentation, applications include automatic description of collections, transcription of historical documents and search engines that answer in natural language citing their sources.
Its technical challenges define the open lines of research:
| Challenge | What it involves |
|---|---|
| Truthfulness | Reducing hallucinations and grounding answers in verifiable sources |
| Currency | Incorporating information after training without retraining the whole model |
| Explainability | Understanding why the model produces a particular answer |
| Bias | Detecting and mitigating biases inherited from the data |
| Efficiency | Reducing the energy consumption and cost of training and using the models |
| Evaluation | Reliably measuring what they can do and where they fail |
| Detection | Distinguishing generated content from human content, which cannot be done reliably today |
3. Hallucinations
A hallucination is an answer that looks correct but is false or invented. In academic work, the most dangerous one is the fabricated reference: an article with plausible authors, title, journal and DOI that does not exist. Walters & Wilder (2023) asked ChatGPT for short literature reviews and checked every reference: a large share of GPT-3.5’s citations were fabricated, and with GPT-4 a smaller but noticeable proportion remained; in addition, many real references contained errors.
4. Responsible uses for study
Kasneci et al. (2023) review opportunities (tailored explanations, writing support, personalised practice) and risks (dependence, errors, bias, plagiarism). A practical criterion is to distinguish uses by what you delegate:
| Use | Risk | Good practice |
|---|---|---|
| Asking it to explain a concept | Medium | Compare with a textbook or a reliable source |
| Generating ideas or an initial outline | Low-medium | Use it as a starting point, not as a result |
| Checking the spelling and clarity of your text | Low | Review each change; the text is still yours |
| Searching for literature | High | Verify every reference in a database |
| Summarising a document | Medium | Read the original; the summary may omit or invent |
| Writing the assignment for you | Unacceptable | It is presenting someone else’s work as your own (Unit 3) |
Before using AI in a course, check what the teaching staff allow and declare its use when required (you will see this in the next chapter).
5. How to verify what an AI produces
- References: look up each one by its DOI (at
doi.orgor Crossref) or by its title in Google Scholar, OpenAlex or the database for your field. Check authors, year and journal. - Data and facts: apply lateral reading and SIFT (Unit 1).
- Attributed quotations: find the sentence in the original source.
- Content: check that the real source says what the AI claims it says.
R practice: checking references against a database
The %in% operator checks which elements of one vector are in another. Imagine an AI has given you five DOIs and you have a list of the DOIs that exist in a database:
Exercise 6.1
Calculate the proportion of fabricated references (those not in the database). Remember that ! reverses a logical value and that mean() of a logical vector gives the proportion of TRUE.
Compare with the vector database.
mean(!(ai_dois %in% database))0.4: two of the five references do not appear. In practice, a DOI missing from a list does not prove it does not exist: you have to look it up at doi.org. But a DOI with a strange format or one that does not resolve is a clear sign of a fabricated reference.
Lab: a miniature language model
Lab · runs in your browser
This toy model has “read” only a dozen sentences about libraries and information. For each word it counts which words follow it and how often (a bigram model). Choose a starting word and the temperature: with low temperature it almost always picks the most likely word; with high temperature it takes more risks. Generate several sentences: you will see fluent and plausible texts, some of them false. Large models are vastly more complex, but they share this idea: predicting what comes next, not checking the truth.
Try: generate sentences from “the” at temperature 2. Do any of them claim something the corpus does not say? That is, on a small scale, a hallucination.
Lab: verifying references
Lab · live data from doi.org and Crossref
Paste the DOIs an AI has given you (one per line; the full link also works). The lab checks at doi.org whether each DOI exists and, if it is registered with Crossref, retrieves the title and year so you can check that they match what the AI told you.
A DOI that exists is not enough: check that the title, authors and year match the reference the AI gave you. Walters & Wilder (2023) found, as well as fabricated references, many real references with errors in their details.
Lab: review your prompt
Lab · runs in your browser · sends nothing to any AI
A good prompt usually gives context, a specific task, the format of the answer, limits and a request for verification. Write yours: the lab looks for those pieces by keywords and suggests what to add. It is a rough guide, not a mark.
Try to improve the example prompt until it has all five pieces and compare it with the one in example 2.
Worked examples
Graded exercises
Basic. Why can a language model fabricate a reference that looks correct?
Because it generates the most likely sequence of words from patterns in its training: it produces something shaped like a reference (plausible authors, a real journal, a year) without checking that it exists.
Intermediate. Rewrite this prompt so that it is useful and safe: “Write the literature review for my bachelor’s thesis”.
Example: “My bachelor’s thesis is about [topic]. Propose a five-section structure for the literature review, with the key concepts of each section and the search terms I should use in Dialnet and Scopus. Do not write the text and do not invent references”. This way the AI helps you plan and does not replace your work.
Advanced. Ask two different AI assistants for ten references on a topic you are interested in, audit them all with the procedure in example 1 and compare the error rates.
Present a table with each reference, its status (correct, with errors, fabricated) and the evidence (DOI, search). State the date and the model used: results change between versions.
Activities
Esta actividad necesita JavaScript.
Esta actividad necesita JavaScript.
Assessed challenge
Self-assessment
Answer all the questions and press Show answers: correct answers turn green, wrong ones red, and you will see your score. You can change your answers and check again. It does not count towards your mark.
- A language model generates text by predicting the most likely fragment that follows a given text.
- An AI answer that looks correct but is false or invented is called a
- If an AI gives a reference with a DOI, authors and journal, the reference exists.
- Which of these uses is riskiest?
- If 3 of 12 references generated by an AI are fabricated, the proportion fabricated is
- Retrieval-augmented generation completely eliminates errors.
- Why can a language model fabricate a plausible reference?
- What a language model knows depends on its data
- Detectors exist today that distinguish AI-generated text from human text with complete reliability.
- To check whether a reference given by an AI exists, the most reliable approach is to
- It repeats that prediction to write the answer.
- A plausible but false answer.
- It may be fabricated: it must be verified.
- Walters and Wilder found many fabricated references.
- 3 / 12 = 0.25.
- It improves currency, but sources must be checked.
- It produces what is plausible, not what is true; there is no intent.
- It may not know recent facts and may inherit their biases.
- Detection is one of the open technical challenges.
- The AI may confidently confirm a false reference.
Further resources
| Resource | What it is for |
|---|---|
| Crossref | Checking DOIs and metadata |
| OpenAlex | Checking whether an article exists |
| UNESCO – Guidance for generative AI in education and research (Miao & Holmes, 2023) | International guidance |