haystack/releasenotes/notes/add-lost-in-the-middle-ranker-6ad7dda754fad5a9.yaml
Vladimir Blagojevic 1876c41f07
feat: Add LostInTheMiddleRanker (#5457)
* Add lost in the middle ranker

* Add release note

* Julian's feedback: more precise version of truncate

* Better comments for the litm algorithm

* Sebastian PR feedback

* Add check for invalid values of word_count_threshold

* Remove _truncate as it is not needed any more

---------

Co-authored-by: Darja Fokina <daria.f93@gmail.com>
2023-08-02 17:05:13 +02:00

19 lines
1.0 KiB
YAML

---
prelude: >
We're excited to introduce a new ranker to Haystack - LostInTheMiddleRanker.
It reorders documents based on the "Lost in the Middle" order, a strategy that
places the most relevant paragraphs at the beginning or end of the context,
while less relevant paragraphs are positioned in the middle. This ranker,
based on the research paper "Lost in the Middle: How Language Models Use Long
Contexts" by Liu et al., can be leveraged in Retrieval-Augmented Generation
(RAG) pipelines.
features:
- |
The LostInTheMiddleRanker can be used like other rankers in Haystack. After
initializing LostInTheMiddleRanker with the desired parameters, it can be
used to rank/reorder a list of documents based on the "Lost in the Middle"
order - the most relevant documents are located at the top and bottom of
the returned list, while the least relevant documents are found in the
middle. We advise that you use this ranker in combination with other rankers,
and to place it towards the end of the pipeline.