← Back to Articles

Prompting

You can structure your prompt using three different roles: systemuser, and assistant. The system message is not required but helps to set the overall behavior of the assistant. The example above only includes a user message which you can use to directly prompt the model.

Elements of a prompt

  • Instruction - a specific task or instruction you want the model to perform
  • Context - external information or additional context that can steer the model to better responses
  • Input Data - the input or question that we are interested to find a response for
  • Output Indicator - the type or format of the output.

The output of a prompt can be heavily influenced by the settings passed to the LLM.

Prompt types

  • Zero-shot prompting - Provides no labeled data. The models rely on their knowledge at training to fill the gaps.
  • One-shot prompting - Provides a single labeled example.
  • Few-shot prompting - Provides multiple examples.
  • Chain-of-thought - Enables more complex "Reasoning" through intermediated reasoning steps. It can be combined with few shot to give better results.

Approaches to prompting learning ?

  • Attribute Based - Models use attribute relationships to generalize knowledge
  • Embedding Based - Models infer knowledge based on similarities. (eg. recommendation models)
  • Generative Approaches - Generates examples of unseen categories
  • Metrics based - Use metrics to predict new categories.
  • Neural network - Correlated input data with predictions
  • Transfer Learning - Uses pre-trained models in general data to teach specific knowledge to a new model

Sources