2024-01-17 Appen Symposium
ChatGPT in Clinical Practice and Research
林協霆
:::
Disclaimer
- Please note that the information provided may not be entirely error-free or up-to-date.
- We recommend independently verifying the content and consulting with professionals for specific advice or information.
- We do not assume any responsibility or liability for the use or interpretation of this content.
Disclosure
NIL
Outline
- What is LLM and ChatGPT
- Prompt Engineering
- Clinical Scenarios
- ChatGPT in Clincial Research
- chatGPT API usage
What is ChatGPT?
- Generative Pre-trained Transformer
- 一系列使用轉換程式架構的神經網路模型
ChatGPT 是一個文字接龍高手
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Why Does It Work?
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
What Is ChatGPT Doing … and Why Does It Work?—Stephen Wolfram Writings
List of LLMs
LLM in Clinical Practice
妄想透過 LLM 來偷懶的人,必將碰得頭破血流
Indication
Contraindication
Clinical Scenarios
Scenario: Translate Chinese to English
初診護理紀錄
65 歲女性,主訴 2021/11 月開始腰酸背痛,至診所就醫,醫生告知腰椎壓迫,建議復健, 但未改善,至中國醫藥學院神經外科就醫,MRI:胸椎 11 節骨折(報告未帶),2021/12/16 灌骨水泥,但腰酸背痛皆未改善,並發現右胸突一塊且越長越大,
2/18 右胸切片:多發性骨髓瘤(報告未帶),今想轉至本院後續治療。
The Prompt
✨Goal: Translate text to English
- as medical "narrative" record
- date format: YYYY-MM-DD
- include all information provided in the text, do not omit anything
- do not makeup not exist information
''''''
{YOUR_TEXT_HERE}
⭐
Scenario: Convert phrases to narrative
PM: 23:59, a new patient from ER
55F p/w Fever chills 3pm~. no sorethroat, rhinorrhea, oral ulcer, cough, chest pain, abdomen pain, dysuria or diarrhea. No headache or myalgia. TOCC negative . Mild DOE since C/T.
In UCU, 38.5; no shock, room air, neutropenia, high CRP level. CXR nl. Confirm with Dr.陳,gave cftz, G-CSF, admitted for infection ctrl. pend COVID and Influenza Ag
The Prompt
Goal: convert the information into medical "narrative" record in paragraph
- date format: YYYY-MM-DD, e.g. 2023-10-09
- include all information provided in the text, don't omit anything
- do makeup not exist information
''''''
{text here}
⭐
Scenario: Convert narrative to bullet points
A 65-year-old female presented with complaints of lower back pain and stiffness that started in November 2021. She sought medical attention at a clinic, where the doctor diagnosed lumbar spine compression and recommended rehabilitation. However, her symptoms did not improve with the prescribed treatment. Subsequently, she visited the Neurosurgery Department at the Chinese Medical University, where an MRI revealed a fracture in the 11th thoracic vertebra (report not available). On 2021-12-16, she underwent vertebroplasty (bone cement injection) to address the fracture, but her lower back pain and stiffness persisted.
Additionally, during the course of evaluation, a lump was noticed in the right chest area, which has been progressively increasing in size. A biopsy of the right chest lump was performed on 2023-02-18, and the results revealed multiple myeloma (report not available). The patient is now seeking further treatment and care at our hospital.
Prompt
Goal: convert the narrative paragraph as bullet points
- order each event chronologically
- for each points/event, format as "- YYYY-MM-DD: event"
''''''
{text here}
⭐⭐
Scenario: Summarize the Note
This 60 y/o postmenopause woman, G1P1, has history of HTN, dyslipidemia, and osteoporosis for years with regular medical control. She has regular health check up and was found to have breast fibrocystic change and proliferative disease at our hospital since 2013. For left breast lesion, she also received thrice FNA of left breast lesion with normal finding in the past. On 2023/07/10 breast sono, there was disclosed BI-RAD:4, a L't 5-mm irregular hypoechoic lesion in 1/2cm, not demonstrated on previous sonogram on 2022/01/18.
On 2023/08/07 FNA to left 1/2 breast lesion showed suspicious for low grade carcinoma. Core biopsy of left 1/2 breast lesion confirmed INVASIVE LOBULAR CARCINOMA. Systemic work up was arranged and reported left breast 1/2 lobular cancer with cT1N0M0, ER: 8, PR: 5, HER2: +/+++. Treatment option was discussed. Under agreement, she was admitted for operation with left breast wide excision plus SLNB.
Prompt
Goal: as oncologist, summarize the information by following rules
- markdown title h2 each points
- patient info (age, gender, past history)
- cancer type(anatomical, histologic),
- cancer grade(high, intermediate, or low),
- cancer stage: International Cancer Control (AJCC/UICC) tumor-node-metastasis (TNM) classification system
(continued)
(continued)
- genetic mutations (if provided)
- disease course; first points should always be "Initial presentation"
- for each course or event, start with time information should always at the begin of line, such as:
- "- (YYYY-MM-DD): event, treatment"
- grouping the event
- reason for hospitalization, in bullet points
⭐⭐
Scenarios: Scan the record and reorganize

Use iPhone to Capture the Text
醫令代碼 開始日期 停止日期 藥品名稱 劑量 總量
ICYCLO5 0970731 0970731 Cyclophosphamide(針劑)500mg/Vial
795
mg (1.59 VI )STAT
IFLUORO10970731 0970731 FluoroUracil 500mg/10ml/VI
795 mg (1.59 VI )STAT
IPHARMO 0970731 0970731 Epirubicin 10mg/VI
159 mg (15.9 VI )STAT
ICYCLO5 0970821
0970821 Cyclophosphamide(針劑)500mg/Vial 795
mg (1.59 VI )STAT
IFLUORO10970821
0970821 FluoroUracil 500mg/10ml/VI
795
… (以下省略 500 字)
Prompt
Goal: create a markdown table
- organize as a markdown tabe,
- identify headings: 醫令代碼 開始日期 停止日期 藥品名稱 劑量 總量
- omit the column "醫令代碼"
- modify date format, add 1911 to first three digits, and convert to the YYYY-MM-DD
e.g. 0980701 will become be 20090701 then format as 2009-07-01
'''
{text here}
'''
⭐⭐⭐
Scenarios: Read a pathology report
Left breast, wide excision with sentinel lymph node biopsy
- Tumor histology: INVASIVE DUCTAL CARCINOMA
- Nottingham grade: 2
- Number and size of invasive carcinoma(s): one tumor, 1.1x0.9x0.7 cm/ 11x9x7 mm
- Estrogen receptor: positive, Allred score=8
- Progesterone receptor: positive, Allred score=8
- HER2 (IHC): non-overexpressed, score=1+
- Ki-67: 23%
Full report here
https://shorturl.at/zIX49
Prompt
Goal: read the pathology report ,
fill up the { }
- if there's not provided, return N/A
Tumor histology: {e.g. Ductal carcinoma},
- pT{ }N{ }, size:{ }, NG{ },
- ER{ }/PR{ }/HER2{ }, Ki-67: { }%, LIV: { }
'''
{report here}
'''
⭐⭐⭐
Prompt, modified
Goal: read the pathology report, return the ER/PR/HER2 status
- for ER/PR, if positive, then return 1 else 0
- for HER2, if more or equal than 3+, which means positive, then return 1, else 0
- if there's not provided, or you are not sure from the text, return NIL
- the result will be three digits sperate by comma like; "0,0,1"
- no explanation
'''
{report here}
'''
⭐⭐⭐
KFSYSCC Experience
Prompt
Engernignering
- Include details in your query to get more relevant answers
- Ask the model to adopt a persona
- Use delimiters to clearly indicate distinct parts of the input
- Specify the steps required to complete a task
- Provide examples
- Specify the desired length of the output
身為唐代詩人李白,寫一首跟蜥蜴有關的五言絕句,最後要說這個蜥蜴跟龍很像,強調蜥蜴動作很快
石隙蜥影閃,
日光鱗閃煌。
跳躍似龍形,
忽隱又忽揚。
OpenAI Platform. Openai.com. Published 2024. Accessed January 16, 2024. https://platform.openai.com/docs/guides/prompt-engineering/six-strategies-for-getting-better-results?utm_source=ai.briefnewsletter.com&utm_medium=newsletter&utm_campaign=chatgpt&fbclid=IwAR00DDKbjTeroAcgkRU1fZ63wUxj1DK002bJfq8I3dxwu7v2oCkJYPYfnHk
Tips
- Domain Priming:
- Be like a…,
- on macos,
- use python, by R
- Sequential Prompting:
- Specify the steps required to perform a task
- Delimiters to distinguish the data from the prompt.
- good: ` " '
- bad: / : \ < >
Ask for Structured Output
The result of chatGPT is markdown based
⭐⭐⭐⭐
Keywords
- if not found then return N/A
- transmit the output of process A to process B for further analysis.
- don't making up nonexistent information.
- truncate the message to fit within the character limit.
- present it in a markdown styled bulleted list.
- iterate through all items to ensure each one meets the required criteria.
- chronologically
- For each …
- If … then … else …
Write clear instructions

Chain-of-Thought Prompting

- 小明 6 歲,哥哥 9 歲,小明 10 歲時,哥哥幾歲
WEI, Jason, et al. Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 2022, 35: 24824-24837.
Step-Back Prompting 🙋

- Before you start, please ask me any questions you have about this so I can give you more context. Be extremely comprehensive.
ZHENG, Huaixiu Steven, et al. Take a step back: evoking reasoning via abstraction in large language models. arXiv preprint arXiv:2310.06117, 2023.
Resource for Prompting 🍲
In Research 🔍
For lit review 📖
Role: Clinician
Goal: Summarize the content in bullet points according to the following rules:
- Use markdown-style bullet points: "- text…"
- Keep each point to less than 80 words.
- Use descriptive yet concise language.
- Avoid overly verbose language and fillers.
- Add an H2 title and H3 subtitle.
⭐
Read Clinical Trial, as markdown
- As a oncologist reading journal about a clinical trial, in the following format:
- Design: Trial phase, II, III, or an meta-analysis, single center or multi-center, randomized or not, or open-label or blind, etc.
- number of patients, patients characteristics
- agent: medication use in this trial
- NCTId Number: e.g.NCTXXXXXXXX
- compare two group in markdown table
esp. Progression-free survival (PFS), Overall survival (OS) and Response rate (RR)
{YOUR_ABSTRACT_HERE}
⭐⭐
Clinical Trial, to json
- As a oncologist reading journal about a clinical trial, in the following format into json dictionary:

GTPs
example: bias assessment for RCT
:::

:::
Credit to Dr. 葉俊廷
:::
Create a search strategy
- create a pubmed search term about "renal cell carcinoma"
- I want it less than 5 years, today is 2024/1/17
- clinical trial only
- return search query for me only, no explain
Code Interpreter (ChatGPT 4)
Q: 我該不該買 ChatGPT 4
A: TL;DR 應該,現在
- draw a bar chart to compare 5 groups of drug comapred with control
- (1)12.4 vs 12.3 (2)15.1 vs 11.1 (3)13.8 vs 8.4 (4)16.6 vs 8.3 (5) 23.9 vs 9.2

完整聊天紀錄
How Does it Work?
For clinical Research
- 請幫我生產一組資料,是一種疾病叫語言模型幻覺,分成兩組,有接受 GPT 治療跟沒接受,其他相關資料包括性別、年紀、存活時間(單位是月),在這組資料中,請讓有接受 GPT 的病人整體存活時間較長,但可以增加一點隨機性,最後提供給我 csv 下載連結
- 產生 kaplan meier curve,
- 有治療對上沒治療

Writing

- language_model_illusion_study.csv 裡面有你要的數據,請分析它
- 根據您提供的具體數據,寫一份研究摘要
Openai API
ChatGPT API playground

Response from a POST request
Json 格式
Batch process table


Thank you for your time and attention
Have a nice day
:::free

:::split
Q & A
:::
結緣品 🙏
