Prompt-Engineering-Guide/guides/prompt-miscellaneous.md

63 lines
2.9 KiB
Markdown
Raw Normal View History

2023-02-09 11:56:56 +08:00
# Miscellaneous Topics
In this section, we discuss other miscellaneous but important topics in prompt engineering.
2023-02-17 14:42:29 +08:00
**Note that this section is under construction.**
2023-02-20 11:06:18 +08:00
Topic:
2023-02-23 14:15:31 +08:00
- [Directional Stimulus Prompting](#directional-stimulus-prompting)
2023-02-20 11:06:18 +08:00
- [Program-Aided Language Models](#program-aided-language-models)
- [ReAct](#react)
2023-02-21 15:15:37 +08:00
- [Multimodal CoT Prompting](#multimodal-prompting)
2023-02-20 11:06:18 +08:00
- [GraphPrompts](#graphprompts)
2023-02-23 14:15:31 +08:00
---
## Directional Stimulus Prompting
[Li et al., (2023)](https://arxiv.org/abs/2302.11520) proposes a new prompting technique to better guide the LLM in generating the desired summary.
A tuneable policy LM is trained to generate the stimulus/hint. Seeing more use of RL to optimize LLMs.
The figure below shows how Directional Stimulus Prompting compares with standard prompting. The policy LM can be small and optimized to generate the hints that guide a black-box frozen LLM.
![](../img/dsp.jpeg)
Full example coming soon!
2023-02-20 11:06:18 +08:00
---
2023-02-19 00:40:32 +08:00
## Program-Aided Language Models
2023-02-19 05:51:36 +08:00
[Gao et al., (2022)](https://arxiv.org/abs/2211.10435) presents a method that uses LLMs to read natural language problems and generate programs as the intermediate reasoning steps. Coined, program-aided language models (PAL), it differs from chain-of-thought prompting in that instead of using free-form text to obtain solution it offloads the solution step to a programmatic runtime such as a Python interpreter.
![](../img/pal.png)
Full example coming soon!
---
## ReAct
2023-02-19 14:54:43 +08:00
[Yao et al., 2022](https://arxiv.org/abs/2210.03629) introduced a framework where LLMs are used to generate both reasoning traces and task-specific actions in an interleaved manner. Generating reasoning traces allow the model to induce, track, and update action plans, and even handle exceptions. The action step allows to interface with and gather information from external sources such as knowledge bases or environments.
2023-02-19 05:51:36 +08:00
The ReAct framework can allow LLMs to interact with external tools to retrieve additional information that leads to more reliable and factual responses.
![](../img/react.png)
2023-02-19 00:40:32 +08:00
Full example coming soon!
2023-02-09 11:56:56 +08:00
2023-02-09 18:12:38 +08:00
---
2023-02-21 15:15:37 +08:00
## Multimodal CoT Prompting
2023-02-17 14:42:29 +08:00
2023-02-21 15:15:37 +08:00
[Zhang et al. (2023)](https://arxiv.org/abs/2302.00923) recently proposed a multimodal chain-of-thought prompting approach. Traditional CoT focuses on the language modality. In contrast, Multimodal CoT incorporates text and vision into a two-stage framework. The first step involves rationale generation based on multimodal information. This is followed by the second phase, answer inference, which leverages the informative generated rationales.
The multimodal CoT model (1B) outperforms GPT-3.5 on the ScienceQA benchmark.
![](../img/multimodal-cot.png)
2023-02-17 14:42:29 +08:00
---
## GraphPrompts
[Liu et al., 2023](https://arxiv.org/abs/2302.08043) introduces GraphPrompt, a new prompting framework for graphs to improve performance on downstream tasks.
2023-02-17 15:52:14 +08:00
More coming soon!
---
[Previous Section (Adversarial Prompting)](./prompt-adversarial.md)