Prompt Engineering Cookbook

Ishant
21 min readAug 9, 2024

--

Part2

How to write effective prompts

A few design patterns

In the previous post, here, I touched upon what is prompt engineering, why is it required, & what are the key parts of a prompt.

In this blog post, I am going to discuss on a few design patterns in prompting (i.e., writing prompt). This is not an exhaustive list but a few design patterns that are impactful.

Why is it important to know these design patterns?

In today’s world, the use of generative artificial intelligence (GenAI) is expanding at an unprecedented rate. And, the exploration of using LLMs to solve the traditional as well as new problems is happening at a fast pace. Thus, in order to stay relevant in the industry, it becomes essential to know how to use LLMs.

The interaction with the LLMs is enabled via prompts. It is, therefore, essential to know how to write prompts. However, just knowing how to write a prompt is not sufficient. It is also important to know how to write an ‘effective’ prompt. An effective prompt is one that can elicit the desired response — a response that meets the user’s expectations.

Who can apply these design patterns?

These can be applied by anybody who intends to generate text using large language models (LLMs). This can be done using the chat interface, API, or any other way in which the LLMs are accessible.

Which models are used here?

For this blog post, I have used the following 2 models: ChatGPT (GPT-4o mini) & Gemini. The purpose of using these 2 models was because of their performance (which is on a relatively higher side compared to many other LLMs). Another factor was the playground availability, so that anybody can try these prompts with minimal setup. However, the ideas in this post are generic ideas that can be applied across LLMs when interacting with them using prompts.

I had used playground options available for both the above. URLs are provided at the end of this post. You should have an account created for accessing the playground features. Alternatively, you can access these models using APIs. However, I have not covered the APIs in this blog post.

Where can these be applied?

These can be applied across various use cases/themes, the possibilities being infinite. The domains where these can be applied can be life sciences, economic, financial, social spheres to name a few. The LLMs like ChatGPT, Gemini, are large & powerful. These have been trained on a large & varied corpus of data. Hence, the breadth of responses that can be generated by giving prompt to these models is extremely large.

How to apply these?

What comes below is a list of 5 design patterns, where each design pattern is first described — what is the design pattern & when to apply it. Then, it is followed by an example, where either a single prompt is provided or a series of prompts (in form of chat conversations) is provided, for the two models mentioned above.

  1. Persona pattern
  2. Refinement pattern
  3. Chain-of-thought (CoT) pattern
  4. Breakdown pattern
  5. Role reversal pattern
Persona pattern

What: Persona pattern is a pattern of writing a prompt where the user asks an LLM to take up a particular role (person, object, or anything else) &, based on that role, generate a response for the specified task.

When to use: Persona patten can be used when you need a response say, from an expert in a field, to whom you would go for getting an answer to your question.

For example: Objective: To create a clinical trial protocol document

ChatGPT:

#USER
Act as a clinical protocol writer. Create a protocol document for a phase 3 study for a molecule for triple negative breast cancer, for target subjects 1000, in the geography US & EU.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT

Clinical Study Protocol

Title: A Phase 3, Randomized, Double-Blind, Placebo-Controlled Study of [Molecule Name] in Patients with Triple-Negative Breast Cancer

Protocol Number: [Protocol Number]

Version: [Version Number]

Date: [Date]

Sponsor: [Sponsor Name]

Investigational Product: [Molecule Name]

Indication: Triple-Negative Breast Cancer (TNBC)

Study Design: Multicenter, Randomized, Double-Blind, Placebo-Controlled, Phase 3 Study

Study Duration: [Total Duration]

Study Sites: US & EU

Study Objectives:

Primary Objective: To evaluate the efficacy of [Molecule Name] compared to placebo in improving overall survival (OS) in patients with triple-negative breast cancer.

Secondary Objectives:

To assess progression-free survival (PFS) in patients receiving [Molecule Name] versus placebo.
To evaluate the safety and tolerability of [Molecule Name].
To assess the impact of [Molecule Name] on quality of life (QoL) in patients with TNBC.
Study Population:

Sample Size: 1000 patients

Inclusion Criteria:

Histologically confirmed triple-negative breast cancer.
Stage II-III disease at diagnosis.
Patients must have received at least one line of prior systemic therapy.
ECOG performance status of 0 or 1.
Age ≥ 18 years.
Adequate organ function as defined by the protocol.
Signed informed consent.
Exclusion Criteria:

Prior treatment with [Molecule Name] or similar agents.
Uncontrolled intercurrent illness.
Other malignancies (except non-melanoma skin cancer) within the past 5 years.
Pregnant or breastfeeding women.
Study Arms:

[Molecule Name] Arm: Patients will receive [Molecule Name] at a dose of [Dose] administered [Frequency].
Placebo Arm: Patients will receive a matching placebo administered [Frequency].
Randomization:

Patients will be randomized in a 1:1 ratio to receive either [Molecule Name] or placebo.
Randomization will be stratified by [stratification factors, e.g., disease stage, prior therapies].
Blinding:

This study will be double-blind. Both the patients and the investigators will be blinded to treatment assignment.
Endpoints:

Primary Endpoint: Overall Survival (OS) – time from randomization to death from any cause.
Secondary Endpoints:
Progression-Free Survival (PFS) – time from randomization to disease progression or death.
Objective Response Rate (ORR) – proportion of patients with a partial or complete response.
Duration of Response (DoR) – time from first objective response to disease progression.
Safety and Tolerability – incidence of adverse events (AEs) and serious adverse events (SAEs).
Quality of Life (QoL) – assessed using [QoL assessment tool].
Safety Assessments:

Adverse events (AEs) will be monitored and recorded throughout the study.
Serious adverse events (SAEs) will be reported in accordance with regulatory requirements.
Statistical Considerations:

Sample Size Calculation: Based on anticipated OS and PFS rates, a sample size of 1000 patients provides [statistical power] to detect a significant difference between treatment arms.
Statistical Analysis Plan: Descriptive statistics will be used for baseline characteristics. OS and PFS will be analyzed using Kaplan-Meier curves and log-rank tests. Safety data will be summarized descriptively.
Ethical Considerations:

The study will be conducted in accordance with the Declaration of Helsinki and Good Clinical Practice (GCP) guidelines.
Ethics committee approval will be obtained at each participating site.
Informed consent will be obtained from all participants prior to any study-related procedures.
Data Management:

Data will be collected and managed using [data management system].
Data quality will be ensured through regular monitoring and audits.
Study Monitoring:

Regular site visits will be conducted to ensure compliance with the protocol and regulatory requirements.
Publication Plan:

Results will be published in peer-reviewed journals and presented at relevant scientific conferences.
Contact Information:

Study Sponsor Contact:

[Contact Name]
[Email Address]
[Phone Number]
Principal Investigator Contact:

[Contact Name]
[Email Address]
[Phone Number]
Note: This is a template and should be reviewed and modified by a clinical trial specialist or regulatory expert to fit the specific requirements of the study and the investigational molecule.

Gemini:

#USER
Act as a clinical protocol writer. Create a protocol document for a phase 3 study for a molecule for triple negative breast cancer, for target subjects 1000, in the geography US & EU.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:

Disclaimer
I am an AI language model and cannot provide medical advice. The following protocol is a hypothetical example and should not be used for any clinical purpose without expert review and approval.

A comprehensive clinical protocol requires in-depth knowledge of the specific molecule, disease state, regulatory requirements, and statistical considerations. This response provides a general outline and should be expanded upon by qualified medical and scientific professionals.

Protocol Outline: Phase 3 Study for Triple Negative Breast Cancer
1. Title: A Phase 3, Randomized, Double-Blind, Placebo-Controlled Study to Evaluate the Efficacy and Safety of [Drug Name] in Patients with Triple Negative Breast Cancer

2. Summary

Brief overview of triple negative breast cancer (TNBC) and its unmet medical need.
Introduction of the study drug and its proposed mechanism of action.
Study objectives, design, endpoints, and target population.
3. Background and Rationale

Comprehensive review of TNBC epidemiology, pathophysiology, and current treatment options.
Preclinical and clinical data supporting the development of the study drug for TNBC.
Rationale for the study design, endpoints, and patient population.
4. Objectives

Primary objective: To evaluate the efficacy of [drug name] compared to placebo in improving progression-free survival (PFS) in patients with TNBC.
Secondary objectives: To assess overall survival (OS), objective response rate (ORR), disease control rate (DCR), safety, and tolerability of [drug name].
5. Study Design

Randomized, double-blind, placebo-controlled, multicenter study.
Patient population: Approximately 1000 patients with confirmed TNBC.
Randomization: Stratified by specific factors (e.g., age, tumor stage, receptor status).
Treatment arms:
Experimental arm: [Drug name] at [dose] and [schedule].
Control arm: Placebo.
Treatment duration: [Specify duration of treatment].
Follow-up: [Specify duration and schedule of follow-up].
6. Study Population

Inclusion criteria: Detailed eligibility criteria for patient enrollment (e.g., age, diagnosis, disease stage, performance status, etc.).
Exclusion criteria: Specific conditions that preclude patient participation (e.g., prior cancer treatment, concomitant medications, etc.).
7. Study Treatments

Detailed description of [drug name] and placebo, including formulation, dosage, administration route, and storage.
Concomitant medications allowed and prohibited.
8. Study Procedures

Screening procedures: Assessments and tests required for patient eligibility.
Baseline assessments: Data collection at study entry (e.g., medical history, physical exam, laboratory tests, imaging studies).
Treatment administration: Procedures for drug administration and monitoring.
Safety assessments: Regular monitoring of adverse events and laboratory parameters.
Efficacy assessments: Methods for evaluating primary and secondary endpoints.
9. Data Collection and Management

Data collection forms and case report forms (CRFs).
Data management and quality control procedures.
Data analysis plan: Statistical methods for analyzing study data.
10. Sample Size and Statistical Considerations

Sample size calculation based on primary endpoint (PFS).
Statistical methods for analysis of primary and secondary endpoints.
Interim analysis plan (if applicable).
11. Study Endpoints

Primary endpoint: PFS.
Secondary endpoints: OS, ORR, DCR, safety, and tolerability.
12. Safety and Monitoring

Adverse event reporting and management.
Independent data monitoring committee (IDMC) oversight.
Safety reporting requirements to regulatory authorities.
13. Quality Assurance and Control

Quality assurance plan to ensure data integrity and compliance.
Quality control measures for study conduct and data management.
14. Ethics and Patient Information

Ethical considerations and compliance with regulatory requirements.
Informed consent process.
Patient rights and confidentiality.
15. Organization and Management

Study organization and responsibilities.
Monitoring plan.
Data and safety monitoring board (DSMB) or IDMC.
16. References

Appendices

Detailed study schedules and timelines.
Case report forms (CRFs).
Statistical analysis plan.
Informed consent form.
Note: This outline provides a basic structure for a phase 3 clinical protocol. Specific details, such as study design elements, endpoints, and statistical considerations, will vary depending on the drug, disease, and regulatory requirements. Collaboration with medical, statistical, and regulatory experts is essential for developing a comprehensive and robust protocol.

Would you like to focus on a specific section of the protocol?

2. Refinement pattern

Refinement pattern

What: Refinement pattern is a pattern of writing a prompt where the user asks the LLM to ‘refine’ his task. Refinement could mean rephrasing, re-articulating etc..

When to use: Refinement patten can be used when your question is ‘general’ & you would like to bring specificity in it, by tapping into LLMs’ worldly knowledge.

For example: Objective: Factors to consider when buying iPhone (purchase decision)

ChatGPT:

#USER:
Whenever I ask a question, suggest a better question. Keep suggesting until I am satisfied.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
I can definitely help refine your questions for better clarity or depth. Let's give it a try! Ask away, and I'll suggest a better version if possible.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
Should I buy iPhone?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
A more refined question could be: "What are the advantages and disadvantages of buying the latest iPhone compared to other smartphones in the same price range?"

Would you like to go deeper or focus on something specific, like features, budget, or alternatives?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
yes

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Here's an even more specific version: "How does the latest iPhone compare to its Android competitors in terms of camera quality, battery life, and overall user experience?"

Is this closer to what you're looking for, or should we explore a different angle?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
USER:
different angle

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Here's a different approach: "Considering my current smartphone usage and preferences, is upgrading to the latest iPhone a worthwhile investment?"

Does this align with what you're thinking, or should we try another direction?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
yes

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Great! If you need help evaluating your current smartphone usage or preferences to make a decision, just let me know.

Gemini:

#USER:
Whenever I ask a question, suggest a better question. Keep suggesting until I am satisfied.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Let's refine your questions!

Feel free to ask me anything. I'll provide suggestions to help you get the information or perspective you're seeking.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
Should I buy iPhone?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Instead of "Should I buy an iPhone?", try:

What are the key advantages of choosing an iPhone over other smartphones?

3. Chain-of-thought (CoT) pattern

CoT pattern

What: CoT pattern is a pattern of writing a prompt where the user asks an LLM to show its line of thinking/reasoning for generating a response to the specified task, by providing a sample question-thoughtprocess-answer as an example/reference.

When to use: CoT patten can be used to make LLM generate more accurate output by showing its thoughtprocess. This has been observed to be useful especially when there are logical inferences/calculations to be performed as a part of the specified task.

For example: Objective: To perform mathematical calculation (addition & subtraction using Vedic Maths)

ChatGPT:

#USER:
Q: Using Vedic Maths, compute: 88756 + 41217 + 59312
A: Steps for adding numbers using Ekadhiken Purvena Sutra:
Step 1: Write the given numbers in rows and columns by giving some space between the digits.
Step 2: In the first column (from the right hand side), add the first two digits, 6 + 7 = 13
Step 3: Mark Ekadhika dot (.) on 1, which is the digit next to 7 in 2nd column (from the right hand side)
Step 4: Now, start again, adding with 2: 3 + 2 = 5
Step 5: Write 5 below as the 1st digit in the answer.
Step 6: Add the remaining columns in the same way.
The final answer is 189285.

Q: Using Vedic Maths, add 876, 450, and 100.
A:

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
To add 876, 450, and 100 using Vedic Maths, particularly the method called Ekadhiken Purvena, follow these steps:

1. Align the Numbers:

876
450
100
2. Add Column by Column from Right to Left:

Units Place:

Add the digits: 6 + 0 + 0 = 6
Write down 6.
Tens Place:

Add the digits: 7 + 5 + 0 = 12
Write down 2 and carry over 1.
Hundreds Place:

Add the digits: 8 + 4 + 1 (carry) = 13
Write down 3 and carry over 1 to the next place (thousands).
3. Combine the Results:

The final sum, including the carried-over digit, is 1326.
So, the result of adding 876, 450, and 100 is 1326.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
Using Vedic Maths, subtract 340 from 634.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
To subtract 340 from 634 using Vedic Maths, you can use the technique called Nikhilam Sutra. Here’s how you do it:

1. Find the Base: Choose a base that is close to the numbers involved. For 634 and 340, the nearest base is 1000.

2. Calculate the Deviations:

634: The deviation from 1000 is 1000−634=366.
340: The deviation from 1000 is 1000−340=660.
3. Subtract the Deviations:

To find the result, subtract the deviation of 340 from the deviation of 634: 366−660=−294
4. Adjust the Result:

Since the deviation is negative, subtract this result from the base: 1000−(−294)=1000+294=1294

Therefore, 634 - 340 equals 1294.

Gemini:

#USER:
Q: Using Vedic Maths, compute: 88756 + 41217 + 59312
A: Steps for adding numbers using Ekadhiken Purvena Sutra:
Step 1: Write the given numbers in rows and columns by giving some space between the digits.
Step 2: In the first column (from the right hand side), add the first two digits, 6 + 7 = 13
Step 3: Mark Ekadhika dot (.) on 1, which is the digit next to 7 in 2nd column (from the right hand side)
Step 4: Now, start again, adding with 2: 3 + 2 = 5
Step 5: Write 5 below as the 1st digit in the answer.
Step 6: Add the remaining columns in the same way.
The final answer is 189285.

Q: Using Vedic Maths, add 876, 450, and 100.
A:

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Adding 876, 450, and 100 using Vedic Maths (Ekadhiken Purvena Sutra)
Understanding the Problem
We're tasked with adding three numbers: 876, 450, and 100, using the Vedic Maths technique called Ekadhiken Purvena (which means "one more than the previous").

Solution Steps
While the Ekadhiken Purvena Sutra is typically used for larger numbers, we can apply it here for consistency.

Step 1: Arrange the numbers in columns:

876
450
+ 100
-----
Step 2: Start from the rightmost column:

Add the digits in the units place: 6 + 0 + 0 = 6
Write 6 as the units digit of the answer.
Step 3: Move to the tens place:

Add the digits: 7 + 5 + 0 = 12
Write 2 as the tens digit of the answer.
Carry over 1 to the hundreds place.
Step 4: Move to the hundreds place:

Add the digits and the carryover: 8 + 4 + 1 + 1 (carryover) = 14
Write 4 as the hundreds digit of the answer.
Carry over 1 to the thousands place.
Step 5: Move to the thousands place:

Since there are no more digits, the carryover becomes the thousands digit of the answer.
Final Answer: 1426

Therefore, 876 + 450 + 100 = 1426.
Note: For such smaller numbers, the traditional addition method might be quicker. However, understanding the Vedic Maths technique is beneficial for more complex calculations.

Would you like to try another example with larger numbers?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
Using Vedic Maths, subtract 340 from 634.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Subtracting 340 from 634 using Vedic Maths (Nikhilam Sutra)
Nikhilam Sutra is generally used for multiplication, but it can be adapted for subtraction as well. However, for simple subtraction like this, the standard method might be quicker.

Let's apply Nikhilam Sutra for the sake of understanding the concept:

Step 1: Find the base:

Choose a base close to both numbers. In this case, let's take 400 as the base.
Step 2: Find the difference from the base:

Difference of 634 from 400 is 234 (excess).
Difference of 340 from 400 is 60 (defect).
Step 3: Apply the rule:

Excess - Defect = Result
234 - 60 = 174
Therefore, 634 - 340 = 174.

As you can see, for such simple calculations, the standard subtraction method would be more efficient. Nikhilam Sutra is more powerful when dealing with larger numbers or multiplication problems.

Would you like to try a more complex subtraction problem or explore a different Vedic Maths technique?

4. Breakdown pattern

Breakdown pattern

What: Breakdown pattern is a pattern of writing a prompt where the user asks the LLM to break a big problem into small subproblems.

When to use: Breakdown patten can be used when solving a given problem is not clear. So, to solve it, you could approach by breaking it into smaller problems &/or by understanding other problems that are related to it.

For example: Objective: To calculate sites required for a given clinical trial

ChatGPT:

#USER:
When you are asked a question, break it down into sub questions. Also, generate additional questions that are related to it and would help you more accurately answer the question. At the end, combine the answers to all the individual questions to produce the final answer.

How many sites to select for a given clinical trial?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
To determine how many sites to select for a clinical trial, you can break down the question into several sub-questions and related considerations:

Sub-Questions
1. What is the primary objective of the trial?
Is it to assess safety, efficacy, or both?
2. What is the target sample size?
How many participants are needed to achieve statistical significance?
3. What is the prevalence of the condition being studied?
How common is the condition in the population?
4. What is the geographical scope of the trial?
Is it a national, regional, or international trial?
5. What is the availability of eligible participants at potential sites?
Are there enough participants who meet the inclusion criteria?
6. What is the site-specific recruitment capacity?
How many participants can each site realistically enroll?
7. What are the logistical and operational considerations?
Are there practical constraints such as budget, resources, and timelines?

Additional Questions
1. What is the trial design and duration?
Is it a short-term study or a long-term follow-up?
2. Are there any regulatory or compliance requirements?
Do different locations have varying regulations?
3. What are the site qualifications and experience?
Do the sites have experience with similar trials?
4. What is the competition with other trials for participants?
Are there other trials in the same area recruiting similar participants?
5. What is the budget for site management and monitoring?
How does the budget influence the number of sites?

Combining the Answers
Once you gather answers to these questions, you can combine them to estimate the number of sites needed. For example, if you need a large sample size and the condition is rare, you might require more sites to reach the target enrollment. Conversely, if the condition is common and sites have high recruitment capacity, fewer sites might suffice. Budget and logistical considerations will also play a role in finalizing the number of sites.

Would you like more details on any of these aspects?

Gemini:

#USER:
When you are asked a question, break it down into sub questions. Also, generate additional questions that are related to it and would help you more accurately answer the question. At the end, combine the answers to all the individual questions to produce the final answer.

How many sites to select for a given clinical trial?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
How many sites to select for a given clinical trial?

Sub-questions:

1. What are the primary factors influencing the number of sites for a clinical trial?
Study design (phase, endpoints, sample size)
Target patient population (size, geographic distribution)
Resource availability (budget, personnel, time)
Regulatory requirements
Ethical considerations

2. What are the advantages and disadvantages of having a large number of sites?
Faster enrollment
Increased diversity
Higher costs
Increased operational complexity

3. What are the advantages and disadvantages of having a small number of sites?
Lower costs
Easier management
Potential for slower enrollment
Reduced patient diversity

4. What are the statistical considerations for determining the optimal number of sites?
Power analysis
Sample size calculation
Dropout rates

5. What are the practical considerations for site selection and management?
Site qualification criteria
Site initiation and training
Site monitoring and oversight
Data management

Additional questions:
What is the specific phase of the clinical trial?
What is the target patient population size and geographic distribution?
What is the available budget for the clinical trial?
What is the desired enrollment timeline?
What are the regulatory requirements for the study?
What is the level of experience of the study team in managing multi-site trials?

Combining answers:
The optimal number of sites for a clinical trial depends on a complex interplay of factors. A larger number of sites can accelerate enrollment and increase patient diversity, but also increases costs and operational complexity. Conversely, a smaller number of sites can reduce costs and simplify management, but may slow enrollment and limit patient diversity.

Statistical considerations, such as power analysis and sample size calculations, are essential for determining the required number of patients. The practical aspects of site selection, initiation, monitoring, and data management should also be carefully evaluated.

By carefully considering these factors and weighing the potential benefits and drawbacks of different options, researchers can determine the optimal number of sites for their specific clinical trial.

Ultimately, the decision of how many sites to select should be based on a comprehensive assessment of the study's objectives, resources, and the specific characteristics of the target patient population.

Would you like to explore any of these factors in more detail?

5. Role reversal pattern

Role reversal pattern

What: Role reversal pattern is a pattern of writing a prompt where the roles of the user & the LLM are reversed, i.e., the LLM asks questions & the user provides answer.

When to use: Role reversal patten can be used when you are not aware of how to solve a problem, &, thus, you need somebody to ask you questions that can help you lead to the answer.

For example: Objective: To select the right investment option(s) in Indian economic market

ChatGPT:

#USER:
Ask me questions on selecting the investment options in Indian economic market. When you have enough information, show me the process.
Ask me the first question.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Sure! Let's start with some basics to tailor the investment options to your needs.

What are your investment goals? For example, are you looking for long-term growth, short-term gains, income generation, or preservation of capital?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
short-term

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Got it. Short-term investments typically focus on quick returns and lower risk. Here’s the next question:

What is your risk tolerance? Are you comfortable with higher risks for potentially higher returns, or do you prefer safer, more stable options?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
stable

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Understood. You’re looking for stable, short-term investments. Here’s the next question:

What is your investment horizon? How long are you planning to keep your money invested? For example, are you looking at a timeframe of a few months, a year, or something else?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
1 year

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Great, you’re aiming for stable, short-term investments with a one-year horizon. Next:

How much capital are you planning to invest? Are you looking at a smaller sum or a larger amount? This will help in identifying the most suitable options.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
larger

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Got it. For a larger capital amount with a one-year horizon and a preference for stable investments, here’s the next question:

Do you prefer investing in individual assets (like stocks) or would you rather go with managed options (like mutual funds or fixed deposits)?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
managed

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Understood. You prefer managed options for a larger capital investment over a one-year period, with a focus on stability.

Do you have any specific preferences or restrictions regarding sectors or types of managed funds (e.g., equity mutual funds, debt funds, fixed deposits, etc.)?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
no

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#CHATGPT:
Great! Based on your preferences for stable, managed investments with a one-year horizon and a larger capital, here’s a process you might follow:

1. Assess Investment Options
Fixed Deposits (FDs): Generally low-risk with fixed returns. Ideal for preserving capital and earning interest.
Debt Mutual Funds: Invest in fixed-income securities. Relatively stable and suitable for short-term investments.
Short-Term Bond Funds: Invest in bonds with shorter durations. They offer relatively stable returns compared to equities.
Liquid Funds: A type of mutual fund that invests in short-term, highly liquid instruments. Suitable for short-term investment with low risk.
2. Evaluate Providers
Compare Interest Rates and Returns: For FDs, compare rates offered by different banks and financial institutions.
Check Fund Performance: For mutual funds, look at historical performance, expense ratios, and ratings by agencies like CRISIL or Morningstar.
3. Consider Tax Implications
Fixed Deposits: Interest income is taxable.
Debt Mutual Funds: Capital gains may be subject to taxation based on the holding period (short-term vs. long-term).
4. Diversification
Mix of Options: Consider spreading your investment across a few managed options to balance stability and returns. For example, combining FDs with short-term debt funds.
5. Consult a Financial Advisor
Personalized Advice: For large investments and specific goals, getting professional advice can ensure you choose the most appropriate options based on current market conditions and your personal financial situation.
If you need more details or have other questions, feel free to ask!

Gemini:

#USER:
Ask me questions on selecting the investment options in Indian economic market. When you have enough information, show me the process.
Ask me the first question.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Question 1:

What is your primary financial goal? Are you saving for a short-term purchase, retirement, or something else?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
short-term

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Question 2:
What is the approximate time horizon for your short-term goal? When do you expect to need the money?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
1 year

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Question 3:
How much risk are you comfortable taking with your investment? Are you looking for something very safe with minimal risk, or are you open to options with slightly higher risk but potentially higher returns?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
very safe

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Question 4:
Do you have a specific amount in mind that you plan to invest for your short-term goal?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
no

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Question 5:
Do you have any existing emergency fund or savings?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
yes

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Question 6:
Given that you have an existing emergency fund, how much additional money are you looking to invest for your short-term goal?

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
large

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Question 7:
By "large," could you please specify a rough estimate of the amount you're considering? This will help us narrow down the investment options.

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#USER:
USD 100000

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#GEMINI:
Understanding Your Investment Needs
Thank you for providing this information.

With a USD 100,000 investment for a short-term goal and a low-risk preference, we'll focus on options that prioritize capital preservation and liquidity.

Let's discuss some potential avenues:
Fixed Deposits (FDs): These are traditional investment options offered by banks and offer a fixed rate of return. They are generally considered safe.
Liquid Funds: These are mutual funds that invest in highly liquid instruments like treasury bills, commercial paper, etc., providing easy access to your money.
Debt Mutual Funds: While they carry slightly more risk than FDs and liquid funds, they offer potential for higher returns. However, we can focus on debt funds with shorter maturities to align with your short-term goal.
Would you like to explore any of these options in more detail?

To access ChatGPT: https://chatgpt.com

To access Gemini: https://gemini.google.com

All photos in this blog post are generated using Gemini.

The writer is a data scientist specialized in natural language processing, generative AI (GenAI), including using large language models, besides classical machine learning.

--

--