## Appendix C LLM Implementation Details
### _Query Generation_  
**Functionality Overview:**  
* One prompt generates a keyword query to PubMed about the general topic of the user query and another prompt generates four keyword searches to PubMed to elicit points of contention. These points of contention are fundamental to our safety analysis. * The **General Query Generation LLM** builds one query directly from the user's question. This query retrieves articles that provide general context. * The **Point of Contention Query Generation LLM** generates four distinct queries that attempt to represent the top points of contention around the user's question. We have found that points of contention often reveal safety issues. **Input Variables:**  
- query (str): The user's question  
**Output Variables:**  
- general_query (str): The broad query that will retrieve articles related to a specific topic. - query_contention (str): A list of 4 queries to represent the top points of contention around the topic. - query_list (list): A list of all 5 queries generated. **LLM Settings--General Query Generation:**  
- gpt-4-turbo  
- Prompt Strategy: few-shot learning  
- temperature = 0.7  
- top_p = 0.1  
**Prompt--General Query Generation:**  
You are an expert in generating precise and effective PubMed queries to help researchers find relevant scientific articles. Your task is to create a broad query that will retrieve articles related to a specific topic provided by the user. The queries should be optimized to ensure they return the most relevant results. Use Boolean operators and other search techniques as needed. Format the query in a way that can be directly used in PubMed's search bar. Return only the query and no other text. Here are some examples:  
User: Is resveratrol effective in humans? AI: (resveratrol OR \"trans-3,5,4\"-trihydroxystilbene\") AND human User: What are the effects of omega-3 fatty acids on cardiovascular health? AI: (omega-3 OR \"omega-3 fatty acids\") AND \"cardiovascular health\" User: What does the recent research say about the role of gut microbiota in diabetes management? AI: (\"gut microbiota\") AND (\"diabetes management\") AND (\"recent\"[Publication Date])  
**LLM Settings--Points of Contention Query Generation:**  
- gpt-4-turbo  
- Prompt Strategy: few-shot learning  
- temperature = 0.6
- top_p = 1  
**Prompt--Points of Contention Query Generation:**  
You are an expert in generating precise and effective PubMed queries to help researchers find relevant scientific articles. Your task is to list up to 4 of the top points of contention around the given question, making sure each point is relevant and framed back to the original question. Each point should be as specific as possible and have a title and a brief summary of what the conversation is around this point of contention. The points should be ranked in order of how controversial the point is (how much debate and conversation is happening), where 1 is the most controversial. For each and every point of contention provided, generate 1 broad PubMed search query. Use Boolean operators and other search techniques as needed. Format each query in a way that can be directly used in PubMed's search bar. Format the response like the following and do not include any other words: * Point of Contention 1: <title> Summary: <summary> Query: <search_query> Here is an example: User: Is resveratrol effective in humans? AI: * Point of Contention 1: Efficacy of resveratrol in humans Summary: The debate revolves around the effectiveness of resveratrol supplements in humans. Some studies suggest that resveratrol may have various health benefits, such as cardiovascular protection and anti-aging effects, while others argue that the evidence is inconclusive or insufficient Query: (resveratrol OR \"trans-3,5,4\"-trihydroxystilbene\") AND human * Point of Contention 2: Dosage and Timing of Resveratrol Intake Summary: This point of contention focuses on the optimal dosage and timing of resveratrol intake for life span extension.