Mastering Retrieval for LLMs - BM25, Fine-tuned Embeddings, and Re-Rankers
Trelis Research
View ChannelAbout
Trelis LTD is a research company based in Dublin, founded by Ronan McGovern 🎥 Watch Trelis AI Tutorials on here on Youtube: youtube.com/@TrelisResearch 🛠 Build & Deploy Faster: Fine-tuning, Inference, Audio, Evals, Robotics and Vision Tools at Trelis.com 💻 Need compute? Get a sign-up bonus on Runpod, affiliate link: https://runpod.io?ref=jmfkcdio 💡 Need Consulting? Get Technical Assistance OR Market Insights: https://forms.gle/2VXzrBzpvm1BmG6e7 💸 Starting a new project or venture? Apply for a Trelis Grant or Investment: https://trelis.com/trelis-ai-grants/
Latest Posts
Video Description
➡️ Get Life-time Access to the Complete Scripts (and future improvements): https://Trelis.com/ADVANCED-fine-tuning ➡️ Runpod Affiliate Link: https://runpod.io?ref=jmfkcdio ➡️ One-click fine-tuning and API templates: https://github.com/TrelisResearch/one-click-llms ➡️ Newsletter: https://blog.Trelis.com ➡️ Resources/Support/Discord: https://Trelis.com/About VIDEO RESOURCES: - Slides: https://docs.google.com/presentation/d/1-hw1e1JgYkAxc-DTxBDmF1XXXTvWc4NtWnJ8-_yHsbQ/edit?usp=sharing - Sentence Bert Models: https://sbert.net/index.html - ALL-SORT Video (LLM retrieval): https://www.youtube.com/watch?v=biJmRQF8bmY TIMESTAMPS: 0:00 Mastering Retrieval (RAG) for LLMs 0:44 Video Overview 13:19 Baseline Performance with No Retrieval 17:29 Document Chunking - Naive vs Sentence based 24:34 BM25 33:20 Semantic / Vector / Embeddings Search 39:59 Cosine vs Dot Product Similarity 43:21 Generating Chunks and Embeddings 50:50 Running BM25 and Similarity Retrieval 55:22 Performance with BM25 vs Similarity 58:36 Fine-tuning embeddings / encoders 1:04:00 Preparing fine-tuning datasets 1:14:54 Embeddings Training Continued 1:22:00 Performance after Fine-tuning 1:25:58 Re-rankers 1:27:10: Cross-encoders 1:30:47 LLM re-rankers 1:36:11 Re-ranking performance 1:48:50 Final Tips
Upgrade Your iPhone Experience
AI-recommended products based on this video

for Magsafe Car Mount【20 Strong Magnets 】Magnetic Phone Holder for Car Phone Holder Mount Dash【360°】Cell Phone Mount for Car Accessories,Car Mount for iPhone 16 Pro Max 15 14 13 12 Plus MagSafe Cases

Magnetic Wireless Charger for iPhone - 3 in 1 Mag-Safe Charging Station for Multiple Devices Apple - Charger Stand Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus Airpods

4-in-1 Wireless Magnetic Power Bank 10800mAh Portable Charger with iWatch Charger, QC4.0+20W PD Fast Charging USB C Battery Pack for Magsafe, iPhone 16/15/14/13/12 Series, Apple Watch etc. (White)

eazpower for Magsafe Power Bank 10000mAh, Magnetic Battery Pack Wireless, 20W PD Fast Charging, Compact Portable Charger with Built-in Cables and Stand for iPhone 16/15/14/13/12/ Apple Watch/Airpods

soundcore P31i by Anker, Real-Time Adaptive Noise Cancelling, Hi-Res Sound, Translation Earbuds, 50H Playtime, Wireless Earbuds, Bluetooth Earphones, Spatial Audio, Fast Charging, IP55 ClimatePartner certified

OHLPRO Tablet Holder for Car, iPad Holder for Car Air Vent Mount, Universal Dashboard Windshield 2-in-1 Cradle TPU Suction Sticky Gel for iPad/iPad mini Samsung Galaxy Size 6"- 10.5" iPad Car Holder

Magnetic Car Mount Air Vent Cell Phone Holder, Universal Vehicle Dash Dashboard Ac Airvent Cellphone Magic Stand with Clip Hook, for iPhone 16 15 Samsung Lenovo Google etc

AINOPE Phone Holder for Car Vent 2025 Gravity Air Vent Car Phone Holder Mount for iPhone 16 Pro Max with Vent Clip Hand Free Cell Phone Car Mount for iPhone 16 Plus Samsung S25 Ultra Car Accesorries
![Miracase Car Phone Mount, [2025 Upgraded Strong Military Grade Suction Cup] Long Arm Phone Holder for Car Dashboard Windshield Vent, Hands Free Cell Phone Holder Compatible with All Mobile Phones Global Recycled Standard](https://m.media-amazon.com/images/I/81oehGW5OLL._AC_UL960_FMwebp_QL65_.jpg)
Miracase Car Phone Mount, [2025 Upgraded Strong Military Grade Suction Cup] Long Arm Phone Holder for Car Dashboard Windshield Vent, Hands Free Cell Phone Holder Compatible with All Mobile Phones Global Recycled Standard
![Spigen Spigen Tempered Glass Screen Protector [GlasTR EZ FIT] designed for Nintendo Switch 2 (2025) - 2 Pack](https://m.media-amazon.com/images/I/61L0hIGSbYL._AC_UL1500_FMwebp_QL65_.jpg)
Spigen Spigen Tempered Glass Screen Protector [GlasTR EZ FIT] designed for Nintendo Switch 2 (2025) - 2 Pack

Anker USB C Charger Cable (6ft 100W, 2Pack), USB 2.0 Type C Fast Charging Cable for iPhone 15 / 15Pro / 15Plus / 15ProMax MacBook Pro 2020, iPad Pro 2020, iPad Air 4, Samsung Galaxy S23+/S23 Ultra ClimatePartner certified
![Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)](https://m.media-amazon.com/images/I/71N7xhCJnoL._AC_UL960_FMwebp_QL65_.jpg)
Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)

Apple AirPods Pro 2 Wireless Earbuds, Bluetooth Headphones, Active Noise Cancellation, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods Global Recycled Standard

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods (Blue) Global Recycled Standard

Wireless Charger for iPhone- 3 in 1 Charging Station for iPhone 16/15/14/13/12/Pro Max/Pro/Mini/Plus, Apple Watch 10/9/8/7/SE/6/5/4/3/2/1/Ultra2/Ultra, AirPods pro/2/3/4

soundcore by Anker P20i True Wireless Earbuds, 10mm Drivers with Big Bass, Bluetooth 5.3, 30H Long Playtime, IPX5 Water-Resistant, 2 Mics for AI Clear Calls, 22 Preset EQs, Customization via App

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

SanDisk 64GB 2-Pack Ultra USB 3.0 Flash Drive (2x64GB) - SDCZ48-064G-GAM462, Black

SanDisk Ultra Flair USB 3.0 64GB Flash Drive High Performance up to 150MB/s (SDCZ73-064G-G46)

SanDisk 32GB 3-Pack Cruzer Glide USB 2.0 Flash Drive (3x32GB) - SDCZ60-032G-G46T, Black

SanDisk 32GB Ultra Dual Drive Go USB Type-C Flash Drive, Black -SDDDC3-032G-GAM46
![Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)](https://m.media-amazon.com/images/I/71N7xhCJnoL._AC_UL960_FMwebp_QL65_.jpg)
Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)

Anker 332 USB-C Hub (5-in-1) with 4K HDMI Display, 5Gbps - and 2 5Gbps USB-A Data Ports and for MacBook Pro, MacBook Air, Dell XPS, Lenovo Thinkpad, HP Laptops and More

Apple AirTag 4 Pack

Apple AirTag 1 Pack

Citymore 4 Pack IPX8 Waterproof for AirTag Keychain,with Soft Silicone AirTags Holder Case Key Ring, Compatible with Apple AirTag for Luggage,Keys, Dog Collar etc




