## 3 Materials and Methods
### System Design and Architecture
#### 3.2.3 Query Generation for Safe Responses  
If the user question passes the validity test, DietNerD then generates five PubMed queries using two LLMs, each with their own few-shot prompting examples to inform PubMed-specific syntax and stylistic preferences (see Appendix C):  
* **General Query Generation LLM:** Generates one PubMed query that represents the user's question and is designed to retrieve articles that provide general context.  
* **Points of Contention Query Generation LLM**: Generates the remaining four PubMed queries by identifying the top four controversial debates surrounding the topic(s) in question and creating a custom query per point of contention. These queries are intended to surface safety considerations, because controversy in the health domain mostly pertains to safety.  
By leveraging a multi-faceted article search strategy, DietNerd considers a broader spectrum of perspectives, which helps prevent bias towards a single viewpoint. Furthermore, it establishes an additional layer of transparency by highlighting any safety concerns or ethical debates and explicitly acknowledging contentious issues derived from reliable sources.  
For example, in Table 2, queries two and three highlight areas where some argue there is insufficient scientific evidence to support certain claims about St. John's Wort. These queries are particularly valuable as they direct research towards contentious areas where empirical data is critically needed to resolve debates. Meanwhile, queries four and five draw attention to potential risks associated with using St. John's Wort as a supplement for individuals already taking depression medication. This approach ensures a comprehensive exploration of both the contested efficacy claims and potential dangers of the treatment. These few-shot prompts enable the LLMs to generate targeted and contextually relevant queries without extensive training. All queries are then aggregated into a list.  
\begin{table}
\begin{tabular}{c c c c} \hline
**Query ID** & **Query Type** & **Summary** & **Query** \\ \hline \multirow{2}{*}{1} & \multirow{2}{*}{General Query} & \multirow{2}{*}{-} & (\"St. John’s Wort\" OR Hypericum) AND (“depression medication” OR antidepressants) \\  & & & AND safety \\ \hline \multirow{4}{*}{2} & \multirow{4}{*}{Point of Contention} & \multirow{2}{*}{The most debated argument is around the potential interaction of St. John’s Wort with antidepressants, particularly SSRIs. Some studies suggest a risk of serotonin syndrome, whereas others argue that the interaction might not be clinically significant.} \\  & & & AND safety \\ \hline \multirow{4}{*}{3} & \multirow{4}{*}{Point of Contention} & \multirow{2}{*}{The debate revolves around whether St. John’s Wort can enhance the effects of standard antidepressants and improve treatment outcomes. While some studies suggest a potential benefit, others find no significant effect.} \\  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \hline \multirow{4}{*}{2} & \multirow{4}{*}{Point of Contention} & \multirow{2}{*}{The debate revolves around whether St. John’s Wort can enhance the effects of standard antidepressants and improve treatment outcomes. While some studies suggest a potential benefit, others find no significant effect.} \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \cline{1-1}  & & & \\ \hline \end{tabular}
\end{table}
Table 2: For every submitted user question, five PubMed queries are generated—each of which captures a different perspective on the question’s topic. Each point of contention query identified includes a summary explaining the debate. Shown below is an example of the five queries that result from the user question: “Is it safe to take St. John’s Wort if you are already on medication for depression?”.