> For the complete documentation index, see [llms.txt](https://docs.thub.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thub.tech/llama-index/response-synthesizer.md).

# 🧪Response Synthesizer

Response Synthesizer nodes are responsible for sending the query, nodes, and prompt templates to the LLM to generate a response. There are 4 modes for generating a response:

#### 1)Refine

Create and refine an answer by sequentially going through each retrieved text chunk.

**Pros**: Good for more detailed answers

**Cons**: Separate LLM call per Node (can be expensive)

<figure><img src="https://1720595571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxWXmt1Z68dgle5JORrEw%2Fuploads%2FdOlX2oIDmRUVaPqyfNhJ%2Fimage.png?alt=media&amp;token=14080292-84bf-4d5c-bd90-178efee342d2" alt=""><figcaption></figcaption></figure>

#### 2)Tree Summarize

When provided with text chunks and a query, recursively build a tree structure and return the root node as the result.

**Pros**: Beneficial for summarization tasks

**Cons**: Accuracy of answer might be lost during traversal of tree structure

<figure><img src="https://1720595571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxWXmt1Z68dgle5JORrEw%2Fuploads%2Fuy9biYEKm1fRE0BSmjfy%2Fimage.png?alt=media&amp;token=61f26023-2953-40dd-9fe8-31d793a1f5e9" alt=""><figcaption></figcaption></figure>
