Purpose: This is a guide to prompt engineering for large language models (LLMs), created by Brex for internal use, based on experience researching and writing LLM prompts for production use cases, covering LLM history as well as strategies, guidelines, and safety recommendations for using and building programmatic systems based on large language models (such as OpenAI GPT-4).
Main capabilities: The document includes an introduction to LLMs, a brief history of language models, prompts and hidden prompts, tokens and token limits, prompt attacks (jailbreaking and leaking), why prompt engineering is needed, semantic search, command syntax, ReAct, a comparison of GPT-4 and GPT-3.5, and strategies such as embedding data, simple lists, Markdown tables, JSON, free text, nested data, citations, programmatic consumption, chain of thought, averaging, explaining code, delimiters, fine-tuning and its drawbacks.
How to use: It is primarily a reading guide; the repository is a documentation-type project on GitHub and does not provide installation commands or code examples. The examples in the document are generated by a nondeterministic language model, and the same example may produce different results.
Applicable scenarios: Suitable for developers and researchers who need to design LLM prompts for production systems, understand prompt security and context management, or build programmatic systems based on LLMs.
Limitations: This document is a continuously updated living document, and LLM best practices evolve rapidly; example results may be inconsistent; no specific installation, pricing, or platform information is provided.