an apparition
Overview
This artwork-in-progress takes the form of an incomplete poem: “I am / falling / in two / but, so be it.” A blinking cursor prompts you to finish what’s been left unsaid.
But as you type about who you are, an auto-complete text prediction tool trained on gendered Reddit forums like r/IncelTear and r/Feminism is already deciding for you.
Typing phrases like “feeling angry” will prompt suggestions drawn from one of two language models. Which binary gender is determined by keywords found in the user's writing, creating an algorithmic apparatus that reinforces patriarchal norms through language.
Context
Language models, from autocomplete systems to large language models, are not neutral technologies. They learn patterns from training data that reflect existing social biases, including gendered assumptions about emotion, behaviour, and expression. These biases become particularly insidious in predictive text systems because they are hidden. Users are encouraged to incorporate AI suggestions into their own writing without realising how their personal expression is being influenced by algorithmic recommendations that further the gender and political divide.
This work responds to research showing that AI text generation systems reproduce and amplify gender stereotypes, conflating masculinity with authority, action, and rationality, while femininity is linked to emotion, appearance, and passivity. Rather than presenting these findings as an essay, ‘an apparition’ makes this logic experiential and visceral.
Design
- Visual encoding of gender bias
- Accepted suggestions from the masculine corpus are most legible due to no transparency being applied, growing slightly in scale when hovered over, while feminine suggestions render in blurred, cramped together with little-to-no spacing, and gradually fade in opacity with each accepted prediction. This creates a visual 'fatigue' effect where feminine language literally becomes harder to read over time, mirroring how certain forms of expression become marginalised. If the model is confused between the two corpus, you might see feminine suggestions appear hidden behind the masculine, or no suggestion at all.
Corpus switches based on keywords - The model looks at the last three words typed for gendered keywords (he/him vs. she/her, strong/brave vs. soft/gentle, etc.) and switches between masculine and feminine training corpora accordingly. This creates a feedback loop where gendered language triggers gendered predictions, which when accepted, trigger more of the same.
Markov chain
Rather than using commercial language models, the work implements a custom text prediction system using Markov chains with 1-gram and 2-gram context windows. This deliberately simple approach makes the mechanics of prediction more transparent and controllable, while still producing recognisably AI-like suggestions.
Technical challenges
Typing flow
- Predictions must appear quickly enough to feel responsive but not so fast they interrupt the user's thought process. Solved through a 1000ms delay timer that resets on each keystroke, only triggering prediction after a natural pause.
Preserving text structure
When users accept predictions, the system must maintain formatting, whitespace, and cursor position (for the most part). The code uses contenteditable on a <div> rather than a textarea, allowing fine-grained control over the DOM. Accepted ghost text is converted to committed <span> elements with appropriate classes, then the caret is programmatically repositioned using the Selection API.
Corpus logic
The system needs to recognise gendered context from partial text without being overly rigid. The solution was to maintain two keyword arrays (MASC_KEYWORDS and FEM_KEYWORDS) and scan the last three words of user input. This provides enough context to catch gendered language while not requiring perfect grammatical structures.
User experience
‘an apparition’ was commissioned as for 'ghost in the loop' by The Photographers' Gallery and Goethe-Institut London, an exhibit that “explore the cultural, societal, emotional, and aesthetic implications of creating art for—and with–machines.” The work will be initially presented online where visitors can sit and write for extended periods.
Unlike the first few poems from ‘orbit’ that encourage quick engagement, this piece is designed for slower, sustained interaction. The gendered bias effects become most apparent after writing several sentences and accepting multiple predictions, creating a cumulative experience where the algorithmic shaping of language becomes increasingly undeniable. While visitors may notice the visual changes immediately; others may only realise retrospectively that the text itself has been encouraged to take a certain turn.
Reflections
This project demonstrates how creative coding can make abstract concepts in AI ethics tangible and experiential. Rather than explaining gender bias in language models through statistics or academic papers, the work lets visitors feel it in their own writing process.
The technical implementation balances simplicity and adaptability. Using vanilla JavaScript and a custom Markov model with open source subreddit APIs keeps the work autonomous and reproducible. The code is open source, allowing other artists and researchers to adapt or suggest improvements to its approach and better its development.
Future iterations
- Expanding beyond binary gender to include non-binary and queer language patterns
- Create a map visualising the Markov chain to show how gendered language clusters
- Creating an 'unbiased' mode that actively suggests counter-stereotypical continuations
Reading
- ‘Building a personal predictive text engine,’ is a blogpost where James talks about developing AutoWrite, a system trained on his own writing. If you ever have the time, it’s lovely to wander through his website. It’s cosy and I always feel like I’m comforted after a visit.
This case study documents the conceptual framework, technical implementation, and exhibition context of an apparition. For technical inquiries, collaboration opportunities, please say hello. To experience the work, open up here.