# LLM Wiki Prompt

A prompt pattern popularized by Andrej Karpathy in 2025, using Zettelkasten-style linked notes to enhance LLM context. It structures information as interconnected notes to improve retrieval and reasoning in large language models.

The LLM Wiki Prompt is a prompt engineering technique that structures contextual information for large language models using a Zettelkasten-inspired system of interconnected notes. Popularized by Andrej Karpathy in 2025, the approach organizes knowledge into discrete, cross-linked entries that mimic a personal knowledge management system, allowing the model to access and synthesize information more effectively than with a linear prompt.

Unlike traditional prompts that present information as a flat block of text, the LLM Wiki Prompt treats each piece of knowledge as a standalone note with its own identifier and links to related concepts. This structure leverages the transformer's attention mechanisms to establish explicit relationships between ideas, reducing ambiguity and improving the coherence of generated responses. The pattern has gained traction among developers and researchers seeking to maximize the utility of context windows in large language models.

## Origins and Popularization

Andrej Karpathy, a prominent figure in artificial intelligence and former director of AI at Tesla, introduced the LLM Wiki Prompt concept in early 2025 through his educational content and social media channels. Karpathy, known for his work on deep learning and his role at OpenAI, demonstrated how the Zettelkasten method - a note-taking system developed by sociologist Niklas Luhmann - could be adapted for interacting with large language models.

Karpathy's advocacy for the pattern stemmed from his observations that models often struggle with long, unstructured prompts. By presenting information as linked notes, he argued, models could better navigate complex topics and maintain consistency across extended conversations. His tutorials and examples quickly spread through the AI community, leading to widespread adoption in both academic and commercial settings.

## Technical Implementation

The LLM Wiki Prompt relies on a specific formatting convention that models can parse reliably. Each note typically includes a title, a body of concise text, and a list of links to other notes using a syntax similar to note-title. The prompt itself consists of a collection of these notes, often preceded by an instruction that explains the format to the model.

For example, a prompt about machine learning might include notes on [neural-network](https://www.wikiprompt.org/wiki/neural-network), [deep-learning](https://www.wikiprompt.org/wiki/deep-learning), and [transformer](https://www.wikiprompt.org/wiki/transformer), with each note containing links to the others. This structure allows the model to follow the links when generating responses, effectively creating a graph of knowledge that it can traverse. The approach works particularly well with models that have been trained on large corpora containing similar markdown-like formats.

## Benefits and Use Cases

The primary benefit of the LLM Wiki Prompt is improved context utilization. By organizing information into discrete, linked units, the pattern reduces the cognitive load on the model and helps it focus on relevant details. This is especially useful for tasks involving multi-step reasoning, such as [curriculum-learning](https://www.wikiprompt.org/wiki/curriculum-learning) or [sequence-to-sequence](https://www.wikiprompt.org/wiki/sequence-to-sequence) generation.

Use cases include:

- **Research assistance**: Compiling notes on related papers and findings, linked by concepts like [multi-head-attention](https://www.wikiprompt.org/wiki/multi-head-attention) or [residual-network](https://www.wikiprompt.org/wiki/residual-network).
- **Technical documentation**: Creating interconnected guides for software libraries or APIs.
- **Creative writing**: Building a wiki of characters, settings, and plot points that the model can reference.
- **Educational tools**: Structuring lessons with links to prerequisites and advanced topics.

## Limitations and Considerations

While the LLM Wiki Prompt is powerful, it has limitations. The effectiveness depends on the model's ability to understand the linking syntax and follow it correctly. Some models may ignore links or misinterpret the format, leading to suboptimal responses. Additionally, creating a well-structured wiki requires upfront effort and domain knowledge.

There is also the question of context window size. Although the pattern improves organization, it does not increase the total amount of information that can be included. For very large knowledge bases, users may need to prioritize which notes to include or use retrieval-augmented generation techniques.

## Future Directions

As large language models continue to evolve, the LLM Wiki Prompt may become a standard tool in the prompt engineering toolkit. Researchers are exploring ways to automate the creation of wiki-style prompts, potentially using models themselves to generate linked notes from raw text. Integration with external knowledge bases and vector databases could further enhance the pattern's capabilities.

Karpathy's contribution has sparked a broader conversation about how to structure information for AI systems. The principles behind the LLM Wiki Prompt - modularity, explicit relationships, and clarity - are likely to influence future developments in human-AI interaction and knowledge management.

---
Source: https://www.wikiprompt.org/wiki/karpathy-llm-wiki-prompt
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-10-07T16:39:41.9362+00:00
