Contents

A Brief Introduction of LLM

What is an LLM?

LLM is short for Large Language Model. All the LLMs are language models, but not all language models are LLMs. The distinctions between large and ‘regular’ are 2 key properties, quantitatively and quanlitatively. Quantitatively means the number of parameters used in the model is pretty large. Qualitatively means that when a language model becomes large, something remarkble will happen.

Zero-shot Learning

This terminology means that the model can perform a task even if it has not been explicitly trained to do it. Previously, if you want to achieve good result in a model, you need to explicitly train it on specific tasks. However, LLMs can do all kinds of language process related work without explicitly training.

Prompt Engineering

Building an LLM from scratch is extremely expensive. With the help of prompt engineering, we can make use of LLM out-of-box (i.e. not training any internal model parameters) while realizing a relatively high value of most of LLM use cases. From my perspective, LLMs can understand the natural language is because of the tokenization step. In this case, they cannot really ‘understand’ the questions in the form of natural language. Thus, in some sense, we are “tricking” these language models to solve problems.

To improve the quality of LLM responses, we can employ specific prompt engineering heuristics (tricks).

  • Be Descriptive (More details will be better): try to include more details in your questions or requests.
  • Give Examples: Adopt the concept of few-shot learning, provide several examples in your prompt will help a lot.
  • Use Structured Text: Organize the structure of the prompt. For example, use ALL CAPS for emphasis, adopt markdown format or use JSON to organize information, etc.
  • Chain of Thought: Guide the LLM to think step by step. Try to break down complex problems into manageable sub-problems . You can simply include “Let’s think step by step” in the prompt. However, in the latest version of some LLMs (like ChatGPT), this strategy doesn’t seems helpful because they may already think step-by-step.
  • Chatbot Personas: Prompt the LLM to take on a particular persona. You may not know the best way to describe your problem to the LLM sometimes, but it helpful if you know who would help you as an expert to solve the problem.
  • Flipped Approach: This is the most exciting approach to treat LLMs as assistants. Since we may not know what the LLM knows or how it thinks, why not flip the characters? Let the LLMs to ask us questions and help us come up with some certain ideas.
    Before:
    What is Reinforcement Learning?
    
    After:
    I want you to ask me questions to help me come up with the
    concept of Reinforcement Learning.
    Ask me one question at a time to keep things conversational.
    
  • Refilect, Review, and Refine: Ask the LLM to review its previous responses or even your prompts and rewrite to refine and improve them.
    Example:
    Review your previous response, pinpoint areas for enhancement
    and offer an improved version.
    Then explain your reasoning for how you improved the response.
    

Reference

A Practical Introduction to LLMs

Prompt Engineering: How to Trick AI into Solving Your Problems