Technical Details of Haiku AI — LLM Haiku Generation, Its Mechanism and Limits

As of 2026, the main LLMs (Claude Opus 4.7, GPT-4o, Gemini 2.5 Pro) can write haiku 'reasonably well.' What is technically happening? Transformer architecture, the difficulty of syllable calculation, integration with kigo dictionaries, biases in training data, prompt engineering, multimodal haiku, evaluation AI — tracing the technical inner workings of haiku AI and the outlook for the late 2020s. The final article of this series.

haikuaillmtransformerprompt-engineeringtechnical

The Technical Interior of “AI That Can Write Haiku”

Article 19 (“Haiku AI and Generative Models”) covered the phenomenon of AI writing haiku and the haiku world’s reaction. This article looks deeper into what is technically happening — from Transformer through syllable calculation, prompting, multimodal, and evaluation AI.

The reader is assumed to be a haiku enthusiast rather than an AI researcher; technical terms are kept minimal but accurate.

Transformer and Large Language Models (LLMs)

The foundation of modern haiku AI is the Transformer, a neural network architecture Google published in 2017. Its main points:

1. Tokenization

Text is split into small units called “tokens.” For Japanese:

  • One character ≠ one token
  • Splitting closer to morphological analysis (“haiku” = 1 token, “furuike ya” = 2-3 tokens depending on the model)
  • Modern main LLMs’ Japanese tokenization is highly accurate

2. The Attention Mechanism

The relation between each word (token) and all other words in the input is computed. This captures context. For haiku:

  • That the “ya” of “furuike ya” is a kireji is “understood” from surrounding relations
  • That “sakura” is a kigo is “recognized” statistically from training data

3. Scale

Post-2022 LLMs (GPT-4, Claude 3, Gemini) are at the scale of tens to trillions of parameters. This absorbs an enormous set of language patterns, including special styles like Japanese, English, and haiku.

4. Generation

Given an input prompt, they generate text by probabilistically predicting the next token repeatedly. For haiku, given “compose an autumn haiku in 5-7-5,” the LLM predicts “autumn → wind → ya → fallen leaves → no → oto → …” and so on.

The Difficulty of Syllable Calculation

Keeping to the 5-7-5 syllable count looks trivial on the surface, but is surprisingly hard for LLMs. Reasons:

1. Token ≠ Syllable

The LLM’s tokens are morpheme or character fragments. “Tōkyō” is 1 token (4 morae), a palatalized “kya, kyu” is 1-2 tokens but 1 mora, “sokuon (っ)” and “chōon (ー)” count as 1 mora each. LLMs are weak with this mismatch.

2. Learning Syllable Counting

LLMs do not learn “syllable counting” explicitly. They infer statistically from training data what “a 5-7-5 haiku looks like in length.” Mostly successful, but occasional failures.

3. Example

Ask an LLM for “10 autumn haiku in 5-7-5”:

  • 8-9 will keep the 5-7-5
  • 1-2 will miscount (4-7-5 or 5-8-5)
  • The LLM does not notice the miscount by itself

4. Externalizing the Syllable Check

Modern professional haiku AI tools operate in two stages: LLM generation + external syllable checker. A loop of “generate → check → regenerate on miscount.”

Integration with Kigo Dictionaries

Haiku requires kigo. LLMs have almost memorized the 5,000 kigo from their training data:

1. Recognition of Kigo

Ask an LLM “What season is sakura the kigo of?” and it answers “a spring kigo” correctly. Likewise for “sanma,” “natsu no tsuki,” “yuki.”

2. Detection of Kicasanari (Overlapping Kigo)

But LLMs are weak at detecting kicasanari. Ask for “a haiku with both sakura and kawazu,” and it will often generate the verse without warning “this is a kicasanari.”

3. Sub-terms and Modern Kigo

Whether the LLM recognizes modern loanwords (Christmas, Valentine’s, Halloween) as kigo depends on the model. It depends on which version of the saijiki is in the training data.

4. Integration with External Kigo APIs

Professional haiku AI systems combine LLM + kigo dictionary API. The generated haiku is checked against the dictionary, judging “this is a spring kigo” or “kicasanari present.”

Biases in Training Data

LLMs’ training data have important biases with respect to haiku:

1. Concentration on Bashō, Kyoshi, Shiki

Training data heavily include the famous verses in textbooks. “Furuike ya,” “Natsukusa ya,” “Kaki kueba” appear in huge volumes of text. As a result, LLMs:

  • Sometimes output these famous verses as-is (which could be treated as plagiarism)
  • Are strongly pulled toward these styles

2. Sparseness of Modern Haiku

The works of Kaneko Tōta, Kishimoto Naoki, and Kōno Saki are in the training data but not in Bashō volumes. As a result, LLMs are less able to reproduce the styles of modern haiku.

3. Absence of Regional and Women’s Haiku

Edo-era women poets (Chiyojo, Sutejo) and regional haiku (Matsue, Shinano) have low exposure in training data. LLMs cannot reproduce these traditions correctly.

4. Time Aspect of Training Data

The cutoff of the training data (latest information point) differs per model. Newer haiku from 2024 on (Kōno Saki’s latest verses, etc.) may not be reflected.

Prompt Engineering

When using haiku AI, how the prompt is written greatly changes the output quality. Practical tips:

A Poor Prompt

Write a haiku

The LLM does not know what to write about or how, and produces a bland haiku.

A Good Prompt

Please compose an autumn evening scene of being alone by a riverbank as a 5-7-5 haiku. The kigo should be “aki no kure” or “yūyake.” Use “ya” or “kana” as the kireji. Aim at Bashō-style calm lyricism.

Specifying subject, syllable count, kigo, kireji, and style concretely raises accuracy.

A More Advanced Prompt

You are a disciple of Bashō, training in haikai. Read the following passage from Oku no Hosomichi and compose a single new verse to follow it. 5-7-5 syllables, an autumn-family kigo, kireji “ya” at the upper five. Be conscious of Bashō’s aesthetics of “yūgen” and “karumi.”

Combining persona (role) + concrete context + constraints + aesthetics invites the LLM to attempt sophisticated imitation.

Iteration and Selection

In practice, getting a perfect haiku in one shot is rare. Generating 20-50 verses and having a human select (curation) is realistic. A form of “co-writing with AI.”

Modern LLMs and Their Haiku Ability

Haiku ability of the main LLMs as of 2026 (based on general observation, not the author’s measurement):

Claude Opus 4.7 (Anthropic)

  • Syllables: keeps 5-7-5 almost reliably
  • Kigo: appropriate selection
  • Kireji: appropriate placement, rare double kireji
  • Cultural depth: medium to high; reproduces Bashō/Kyoshi-style lyricism
  • Originality: medium, within the range of the training data

GPT-4o / GPT-5 (OpenAI)

  • Syllables: high probability of keeping
  • Kigo: appropriate, handles modern kigo (Christmas etc.)
  • Kireji: appropriate, occasional double kireji
  • Cultural depth: medium
  • Originality: medium

Gemini 2.5 Pro (Google)

  • Syllables: kept, but sometimes drift
  • Kigo: handled, including modern kigo
  • Kireji: handled
  • Cultural depth: medium
  • Multimodal: haiku generation from image input is possible (Gemini’s strength)

DeepL Write / Japanese-specialized Models

  • Japanese syllable counting: more accurate than English-centric LLMs
  • Kigo: detailed
  • Integration with translation: easy to combine with EN-JA translation

Conclusion: The haiku ability of the three main LLM providers is roughly on par as of 2026. Differences are subtle, and it is now a stage of choosing by use case.

Multimodal Haiku — Haiku from Image

Multimodal LLMs (GPT-4o, Claude Opus 4.7, Gemini 2.5 Pro) can take an image as input and generate a haiku. Example:

Case

Image input: a photo of autumn Kyoto, the Ginkaku-ji autumn leaves

Prompt: “Please make this image into a haiku.”

Output example:

Ginkaku ya / koke musu niwa no / aki fukashi

Features:

  • Extracts concrete objects (Ginkaku, garden, autumn) from the image
  • Selects seasonal feeling (aki fukashi)
  • Places kireji “ya”

Applications

  • Tourism-site haiku AR apps — take a photo of the scene, AI returns a haiku
  • Support for photo haiku — for amateurs adding a verse to a photo, AI proposes a draft
  • International exchange — non-Japanese tourists can make haiku from an image

Current Limits

  • Missing details of the image (shadow, light quality)
  • Season judgment errors (photos with only evergreens leave the season unclear)
  • Missing cultural context (the historical meaning of the temple, etc.)

Evaluation AI — AI That Judges the Quality of a Haiku

Distinct from generative AI, research on AI that evaluates the quality of a haiku is progressing:

1. Statistical Evaluation

  • Accuracy of syllable count
  • Presence and overlap of kigo
  • Appropriateness of the kireji
  • These can be judged automatically

2. Evaluation of Poetic Feeling

The subjective evaluation of “is this verse fine as a poem?” This is still hard for AI:

  • Trials using selection data from expert haiku poets as training data
  • Binary classification with publication / non-publication in comprehensive journals as the label
  • Current accuracy is 60-70%, below human agreement (80-90%)

3. Applications

  • Preselection of the Haiku Kōshien using evaluation AI (in trial)
  • Preliminary filtering of submissions to comprehensive journals by AI
  • Feedback in educational settings for student haiku

4. Future

The combination of generative AI + evaluation AI could enable large-scale generation of high-quality haiku. This has the potential to change the very nature of haiku creation.

At present, world copyright law has not reached a clear conclusion about the copyright of AI-generated works. Under discussion in the US, Japan, and the EU.

Points at Issue

  1. A haiku generated solely by AI — does copyright arise, and if so, whose?
  2. A haiku co-written by human and AI — the proportion of human creativity is at issue
  3. AI whose training data uses existing famous verses — is return to rightsholders needed?

The Current State of the Haiku World

  • Haiku Kōshien: high-school students submitting AI-generated verses is banned
  • Comprehensive journals: in principle, AI-generated verses are not carried, but judgment is difficult
  • Head-led journals: at the head’s discretion; not unified
  • SNS: publishable if AI generation is disclosed — a general agreement

Outlook for the Late 2020s

As of 2026 when this series is being written, haiku AI is still developing. Predictions for the late 2020s (2027-2030):

1. Personalized Haiku AI

An AI that learns each user’s past posts, interests, and life patterns, and proposes haiku matched to that person’s “characteristic voice.” Coupled with SNS platforms.

2. Deepening of Multimodality

Improved generation of haiku from image, audio, and video. Applications like scanning a QR code at a tourism site to receive a haiku matched to that place’s scenery.

3. Real-Time Kukai AI

AI joining online kukai as a participant, submitting and selecting verses in real time. “Mixed kukai of AI and humans” may be tried experimentally.

4. Serious Introduction in Education

Haiku AI becomes standard teaching material in junior high and high school Japanese-language classes. Students learn haiku in dialogue with AI.

5. International Haiku Support

Multilingual AI supports the dialogue of world poets by translating Japanese haiku into English, French, Korean. It functions as infrastructure of the world-haiku community.

Essential Questions Around “AI and Haiku”

No matter how far the technology advances, essential questions remain:

1. Who is the “Subject” Who Writes the Haiku?

The human who inputs the prompt, the AI that generates it, or the past poets who provided the training data? The question of where creativity resides.

2. Who Decides the “Artistic Value” of a Haiku?

An AI-generated “technically perfect” haiku, and a “clumsy but truthful” haiku made by a human within life. Which is the “real haiku”?

3. The Act of “Reading” a Haiku

Is it possible to be moved by reading an AI-generated verse? When emotion arises, is it admiration for the AI’s cleverness, or empathy with human poetic feeling?

4. Relation to a 400-Year Tradition

How is AI haiku situated within the haiku tradition built by Bashō, Buson, Issa, Kyoshi, Tōta? A new 21st-century school, or a different verse form altogether?

These questions have been suggested through the 33 articles of this series but do not have clear answers. They are questions that 21st-century haiku people, enthusiasts, and technologists will think through, practice, and answer over the coming 30-70 years.

The Conclusion of This Series

The “Haiku: 400 Years” series finishes with 33 articles + overview = 34 pieces of content. It has traced 400 years from Teitoku’s Teimon haikai (early 17th century) to modern generative AI (2020s), through multifaceted lenses of principal figures, works, techniques, thought, region, internationalization, and technology.

“Why has the 17 sound continued to live for 400 years?” — a partial answer:

  1. The extreme shortness of 17 sounds in fact maximizes the room for the reader’s imagination
  2. The system of 5,000 kigo compensates for the shortness with information density
  3. The kireji “ya,” “kana,” “keri” give the 17 sounds a structural skeleton
  4. Each era’s poets’ attempts have accumulated devices for folding modern subjects into 17 sounds
  5. Head-led journals, kukai, the Haiku Kōshien, SNS — mechanisms of continuation are layered
  6. Amid the new variables of internationalization and AI, new verses continue to appear

From Matsunaga Teitoku 400 years ago, and Bashō, Issa, Shiki, Kyoshi, Santōka, Tōta — out of the collective accomplishment of 400 years of poets, 21st-century poets keep writing new 17 sounds. And 22nd-century poets, too, will surely inscribe their era’s life in the same 5-7-5 frame.

Finally, in Bashō’s Words

A phrase Bashō is said to have used in his late years:

“Fueki ryūkō”

The unchanging (the 17 sounds, kigo, kireji) and the ever-changing (the era’s subjects, the reality of life) — both make haiku itself. Bashō’s 400-year-old phrase remains a valid guide for us in 2026 as generative AI writes haiku.

May this series be one gateway to the universe of haiku for the reader. From Bashō, Buson, Issa, Shiki, Kyoshi, Santōka, Hōsai, Tōta, to modern poets like Kōno Saki and Iwata Kei — keep reading the verses of the 400 years of poets.

And if you should ever wish to make a 5-7-5 yourself, that is a new participation in a 400-year tradition. No matter how clumsy your verse, the frame of 17 sounds built up from Teitoku to Tōta is waiting for your verse.

← Back to Haiku: 400 Years