Context Injection

Neil HaddleyJuly 19, 2023

Context Injection

What is Context Injection?

Context injection is a technique that involves providing GPT-4 with additional relevant information from your knowledge base alongside the user’s query. This helps guide the model’s response and enhances its accuracy, relevance, and specificity. While it is too expensive (and impractical) to place your entire knowledge base at the beginning of every prompt, it is possible to create a database of the knowledge you want your LLM-based application (such as ChatGPT) to have access to. Then, use that database to help engineer prompts behind the scenes. This technique has two specific benefits: (1) prompts are always more efficiently written, and (2) your data are always up to date.

Results

Results

context injection

TEXT
1You are an enthusiastic student keen to impress. Given the following text, answer the questions using only the text. If you are unsure and the answer is not explicitly in the text, say 'Sorry, I don't know how to answer that question".
2
3text:
4I have, myself, full confidence that if all do their duty, if nothing is neglected, and if the best arrangements are made, as they are being made, we shall prove ourselves once again able to defend our Island home, to ride out the storm of war, and to outlive the menace of tyranny, if necessary for years, if necessary alone.
5At any rate, that is what we are going to try to do. That is the resolve of His Majesty’s Government - every man of them. That is the will of Parliament and the nation.
6The British Empire and the French Republic, linked together in their cause and in their need, will defend to the death their native soil, aiding each other like good comrades to the utmost of their strength.
7Even though large tracts of Europe and many old and famous States have fallen or may fall into the grip of the Gestapo and all the odious apparatus of Nazi rule, we shall not flag or fail.
8We shall go on to the end, we shall fight in France, we shall fight on the seas and oceans, we shall fight with growing confidence and growing strength in the air, we shall defend our Island, whatever the cost may be, we shall fight on the beaches, we shall fight on the landing grounds, we shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender, and even if, which I do not for a moment believe, this Island or a large part of it were subjugated and starving, then our Empire beyond the seas, armed and guarded by the British Fleet, would carry on the struggle, until, in God’s good time, the New World, with all its power and might, steps forth to the rescue and the liberation of the old.
9
10
11
12Questions: 
131) Why does Churchill repeat the phrase “we shall fight” over and over?
142) How does it support the main purpose of this speech?
153) What did President Roosevelt think of the speech?