<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE GmsArticle SYSTEM "http://www.egms.de/dtd/2.0.34/GmsArticle.dtd">
<GmsArticle xmlns:xlink="http://www.w3.org/1999/xlink">
  <MetaData>
    <Identifier>25gmds210</Identifier>
    <IdentifierDoi>10.3205/25gmds210</IdentifierDoi>
    <IdentifierUrn>urn:nbn:de:0183-25gmds2101</IdentifierUrn>
    <ArticleType>Meeting Abstract</ArticleType>
    <TitleGroup>
      <Title language="en">Prompt Engineering Strategies for Context-Aware Medical Text Anonymization Using LLMs: Insights from the GraSCCo Corpus</Title>
    </TitleGroup>
    <CreatorList>
      <Creator>
        <PersonNames>
          <Lastname>Wolfien</Lastname>
          <LastnameHeading>Wolfien</LastnameHeading>
          <Firstname>Markus</Firstname>
          <Initials>M</Initials>
        </PersonNames>
        <Address>
          <Affiliation>Institute for Medical Informatics and Biometry, Faculty of Medicine Carl Gustav Carus, TUD Dresden University of Technology, Dresden, Germany</Affiliation>
          <Affiliation>Center for Scalable Data Analytics and Artificial Intelligence, Dresden&#47;Leipzig, Germany, Dresden, Germany</Affiliation>
        </Address>
        <Creatorrole corresponding="no" presenting="no">author</Creatorrole>
      </Creator>
      <Creator>
        <PersonNames>
          <Lastname>Teschner</Lastname>
          <LastnameHeading>Teschner</LastnameHeading>
          <Firstname>Florin</Firstname>
          <Initials>F</Initials>
        </PersonNames>
        <Address>
          <Affiliation>Institute for Medical Informatics and Biometry, Faculty of Medicine Carl Gustav Carus, TUD Dresden University of Technology, Dresden, Germany</Affiliation>
        </Address>
        <Creatorrole corresponding="no" presenting="no">author</Creatorrole>
      </Creator>
      <Creator>
        <PersonNames>
          <Lastname>Nguyen</Lastname>
          <LastnameHeading>Nguyen</LastnameHeading>
          <Firstname>Hung Manh</Firstname>
          <Initials>HM</Initials>
        </PersonNames>
        <Address>
          <Affiliation>Institute for Medical Informatics and Biometry, Faculty of Medicine Carl Gustav Carus, TUD Dresden University of Technology, Dresden, Germany</Affiliation>
        </Address>
        <Creatorrole corresponding="no" presenting="no">author</Creatorrole>
      </Creator>
      <Creator>
        <PersonNames>
          <Lastname>Sedlmayr</Lastname>
          <LastnameHeading>Sedlmayr</LastnameHeading>
          <Firstname>Martin</Firstname>
          <Initials>M</Initials>
        </PersonNames>
        <Address>
          <Affiliation>Institute for Medical Informatics and Biometry, Faculty of Medicine Carl Gustav Carus, TUD Dresden University of Technology, Dresden, Germany</Affiliation>
        </Address>
        <Creatorrole corresponding="no" presenting="no">author</Creatorrole>
      </Creator>
    </CreatorList>
    <PublisherList>
      <Publisher>
        <Corporation>
          <Corporatename>German Medical Science GMS Publishing House</Corporatename>
        </Corporation>
        <Address>D&#252;sseldorf</Address>
      </Publisher>
    </PublisherList>
    <SubjectGroup>
      <SubjectheadingDDB>610</SubjectheadingDDB>
      <Keyword language="en">German clinical text</Keyword>
      <Keyword language="en">large language model (LLM)</Keyword>
      <Keyword language="en">prompt engineering</Keyword>
      <Keyword language="en">anonymization</Keyword>
      <Keyword language="en">semantic pre-processing</Keyword>
      <Keyword language="en">de-identification</Keyword>
    </SubjectGroup>
    <DatePublishedList>
      <DatePublished>20260401</DatePublished>
    </DatePublishedList>
    <Language>engl</Language>
    <License license-type="open-access" xlink:href="http://creativecommons.org/licenses/by/4.0/">
      <AltText language="en">This is an Open Access article distributed under the terms of the Creative Commons Attribution 4.0 License.</AltText>
      <AltText language="de">Dieser Artikel ist ein Open-Access-Artikel und steht unter den Lizenzbedingungen der Creative Commons Attribution 4.0 License (Namensnennung).</AltText>
    </License>
    <SourceGroup>
      <Meeting>
        <MeetingId>M0631</MeetingId>
        <MeetingSequence>210</MeetingSequence>
        <MeetingCorporation>Deutsche Gesellschaft f&#252;r Medizinische Informatik, Biometrie und Epidemiologie</MeetingCorporation>
        <MeetingName>70. Jahrestagung der Deutschen Gesellschaft f&#252;r Medizinische Informatik, Biometrie und Epidemiologie e. V. (GMDS)</MeetingName>
        <MeetingTitle></MeetingTitle>
        <MeetingSession>PS 12: Machine learning and AI applications</MeetingSession>
        <MeetingCity>Jena</MeetingCity>
        <MeetingDate>
          <DateFrom>20250907</DateFrom>
          <DateTo>20250911</DateTo>
        </MeetingDate>
      </Meeting>
    </SourceGroup>
    <ArticleNo>Abstr. 239</ArticleNo>
    <Fundings>
      <Funding fundId="01ZZ2314F">Bundesministerium f&#252;r Forschung, Technologie und Raumfahrt (BMFTR)</Funding>
    </Fundings>
  </MetaData>
  <OrigData>
    <TextBlock name="Text" linked="yes">
      <MainHeadline>Text</MainHeadline><Pgraph><Mark1>Introduction:</Mark1> The anonymization of clinical texts remains an ongoing challenge for enabling secondary use of healthcare data. With the increasing capabilities of large language models (LLMs) like ChatGPT-4.0, new opportunities arise for automating de-identification tasks <TextLink reference="1"></TextLink>, <TextLink reference="2"></TextLink>. However, performance is highly sensitive to prompt design and document formatting <TextLink reference="3"></TextLink>. This study evaluates how different prompt engineering strategies and input structuring can impact anonymization quality on synthetic German discharge letters from the GraSCCo corpus <TextLink reference="4"></TextLink>, <TextLink reference="5"></TextLink>.</Pgraph><Pgraph><Mark1>Methods:</Mark1> Three anonymization strategies were compared using ChatGPT-4.0: (i) a single static prompt applied in a continuous session, (ii) prompt renewal with isolated sessions per document, and (iii) structured input with semantically segmented sections combined with prompt renewal. All approaches used the GeMTeX anonymization guideline as a reference. Outputs were manually reviewed and evaluated using precision, recall, F1-score, and error rate.</Pgraph><Pgraph><Mark1>Results:</Mark1> Anonymization performance remained constant across iterations, with F1-scores around 0.72 (static prompt) to 0.79 (structured input). The error rate dropped from 19.4&#37; to 7.6&#37;, demonstrating a slight benefit of both prompt renewal and document structuring. However, these improvements were accompanied by a notable increase in false positives, particularly in masking non-identifying medical terms, such as medications and lab values.</Pgraph><Pgraph><Mark1>Discussion:</Mark1> Prompt engineering and input formatting can affect the reliability of LLM-based anonymization <TextLink reference="6"></TextLink>. While structured prompting did not improve overall F1-score, it increases over-masking, emphasizing the need for careful balance between data utility and privacy. Future work should explore prompt fine-tuning, guided pre-processing based on segment length, and hybrid approaches combining LLMs with rule-based verification. Local deployment using models like Ollama or DeepSeek may support clinical integration under privacy-sensitive conditions.</Pgraph><Pgraph><Mark1>Acknowledgements:</Mark1> This work was supported by the Federal Ministry of Research, Technology and Space (BMFTR) as part of the GeMTeX-Project (FKZ: 01ZZ2314F).</Pgraph><Pgraph>The authors declare that they have no competing interests.</Pgraph><Pgraph>The authors declare that an ethics committee vote is not required.</Pgraph></TextBlock>
    <References linked="yes">
      <Reference refNo="1">
        <RefAuthor>Patsakis C</RefAuthor>
        <RefAuthor>Lykousas N</RefAuthor>
        <RefTitle>Man vs the machine in the struggle for effective text anonymisation in the age of large language models</RefTitle>
        <RefYear>2023</RefYear>
        <RefJournal>Sci Rep</RefJournal>
        <RefPage>16026</RefPage>
        <RefTotal>Patsakis C, Lykousas N. Man vs the machine in the struggle for effective text anonymisation in the age of large language models. Sci Rep. 2023 Sep 25;13(1):16026.</RefTotal>
      </Reference>
      <Reference refNo="2">
        <RefAuthor>Liu Z</RefAuthor>
        <RefAuthor>Huang Y</RefAuthor>
        <RefAuthor>Yu X</RefAuthor>
        <RefAuthor>Zhang L</RefAuthor>
        <RefAuthor>Wu Z</RefAuthor>
        <RefAuthor>Cao C</RefAuthor>
        <RefAuthor>Dai H</RefAuthor>
        <RefAuthor>Zhao L</RefAuthor>
        <RefAuthor>Li Y</RefAuthor>
        <RefAuthor>Shu P</RefAuthor>
        <RefAuthor>Zeng F</RefAuthor>
        <RefAuthor>Sun L</RefAuthor>
        <RefAuthor>Liu W</RefAuthor>
        <RefAuthor>Shen D</RefAuthor>
        <RefAuthor>Li Q</RefAuthor>
        <RefAuthor>Liu T</RefAuthor>
        <RefAuthor>Zhu D</RefAuthor>
        <RefAuthor>Li X</RefAuthor>
        <RefTitle>DeID-GPT: Zero-shot Medical Text De-Identification by GPT-4</RefTitle>
        <RefYear>2023</RefYear>
        <RefJournal>arXiv</RefJournal>
        <RefPage></RefPage>
        <RefTotal>Liu Z, Huang Y, Yu X, Zhang L, Wu Z, Cao C, Dai H, Zhao L, Li Y, Shu P, Zeng F, Sun L, Liu W, Shen D, Li Q, Liu T, Zhu D, Li X. DeID-GPT: Zero-shot Medical Text De-Identification by GPT-4 &#91;Preprint&#93;. arXiv. 2023. DOI: 10.48550&#47;arXiv.2303.11032</RefTotal>
        <RefLink>https:&#47;&#47;doi.org&#47;10.48550&#47;arXiv.2303.11032</RefLink>
      </Reference>
      <Reference refNo="3">
        <RefAuthor>Shusterman R</RefAuthor>
        <RefAuthor>Waters AC</RefAuthor>
        <RefAuthor>O&#8217;Neill S</RefAuthor>
        <RefAuthor>Bangs M</RefAuthor>
        <RefAuthor>Luu P</RefAuthor>
        <RefAuthor>Tucker DM</RefAuthor>
        <RefTitle>An active inference strategy for prompting reliable responses from large language models in medical practice</RefTitle>
        <RefYear>2025</RefYear>
        <RefJournal>Npj Digit Med</RefJournal>
        <RefPage>1&#8211;10</RefPage>
        <RefTotal>Shusterman R, Waters AC, O&#8217;Neill S, Bangs M, Luu P, Tucker DM. An active inference strategy for prompting reliable responses from large language models in medical practice. Npj Digit Med. 2025 Feb 22;8(1):1&#8211;10.</RefTotal>
      </Reference>
      <Reference refNo="4">
        <RefAuthor>Modersohn L</RefAuthor>
        <RefAuthor>Schulz S</RefAuthor>
        <RefAuthor>Lohr C</RefAuthor>
        <RefAuthor>Hahn U</RefAuthor>
        <RefTitle>GRASCCO &#8211; The First Publicly Shareable, Multiply-Alienated German Clinical Text Corpus</RefTitle>
        <RefYear>10</RefYear>
        <RefBookTitle>German Medical Data Sciences 2022 &#8211; Future Medicine: More Precise, More Integrative, More Sustainable&#33;</RefBookTitle>
        <RefPage>66&#8211;72</RefPage>
        <RefTotal>Modersohn L, Schulz S, Lohr C, Hahn U. GRASCCO &#8211; The First Publicly Shareable, Multiply-Alienated German Clinical Text Corpus. In: German Medical Data Sciences 2022 &#8211; Future Medicine: More Precise, More Integrative, More Sustainable&#33; IOS Press; 2022. p. 66&#8211;72. DOI: 10.3233&#47;SHTI220805</RefTotal>
        <RefLink>https:&#47;&#47;doi.org&#47;10.3233&#47;SHTI220805</RefLink>
      </Reference>
      <Reference refNo="5">
        <RefAuthor>Lohr C</RefAuthor>
        <RefAuthor>Matthies F</RefAuthor>
        <RefAuthor>Faller J</RefAuthor>
        <RefAuthor>Modersohn L</RefAuthor>
        <RefAuthor>Riedel A</RefAuthor>
        <RefAuthor>Hahn U</RefAuthor>
        <RefAuthor>Kiser R</RefAuthor>
        <RefAuthor>Boeker M</RefAuthor>
        <RefAuthor>Meineke F</RefAuthor>
        <RefTitle>De-Identifying GRASCCO &#8211; A Pilot Study for the De-Identification of the German Medical Text Project (GeMTeX) Corpus</RefTitle>
        <RefYear>In</RefYear>
        <RefTotal>Lohr C, Matthies F, Faller J, Modersohn L, Riedel A, Hahn U, Kiser R, Boeker M, Meineke F. De-Identifying GRASCCO &#8211; A Pilot Study for the De-Identification of the German Medical Text Project (GeMTeX) Corpus. In: German Medical Data Sciences 2024. IOS Press; 2024. p. 171&#8211;9. DOI: 10.3233&#47;SHTI240853</RefTotal>
        <RefLink>http:&#47;&#47;dx.doi.org&#47;10.3233&#47;SHTI240853</RefLink>
      </Reference>
      <Reference refNo="6">
        <RefAuthor>Wiest IC</RefAuthor>
        <RefAuthor>Le&#223;mann ME</RefAuthor>
        <RefAuthor>Wolf F</RefAuthor>
        <RefAuthor>Ferber D</RefAuthor>
        <RefAuthor>Treeck MV</RefAuthor>
        <RefAuthor>Zhu J</RefAuthor>
        <RefAuthor>Ebert MP</RefAuthor>
        <RefAuthor>Westphalen CB</RefAuthor>
        <RefAuthor>Wermke M</RefAuthor>
        <RefAuthor>Kather JN</RefAuthor>
        <RefTitle>Deidentifying Medical Documents with Local, Privacy-Preserving Large Language Models: The LLM-Anonymizer</RefTitle>
        <RefYear>2025</RefYear>
        <RefJournal>NEJM AI</RefJournal>
        <RefPage>AIdbp2400537</RefPage>
        <RefTotal>Wiest IC, Le&#223;mann ME, Wolf F, Ferber D, Treeck MV, Zhu J, Ebert MP, Westphalen CB, Wermke M, Kather JN. Deidentifying Medical Documents with Local, Privacy-Preserving Large Language Models: The LLM-Anonymizer. NEJM AI. 2025 Mar 27;2(4):AIdbp2400537.</RefTotal>
      </Reference>
    </References>
    <Media>
      <Tables>
        <NoOfTables>0</NoOfTables>
      </Tables>
      <Figures>
        <NoOfPictures>0</NoOfPictures>
      </Figures>
      <InlineFigures>
        <NoOfPictures>0</NoOfPictures>
      </InlineFigures>
      <Attachments>
        <NoOfAttachments>0</NoOfAttachments>
      </Attachments>
    </Media>
  </OrigData>
</GmsArticle>