← Latest papers
💻 computer science

Automated Generation of Accurate Privacy Captions From Android Source Code Using Large Language Models

This paper introduces PCapGen, an automated framework that leverages Large Language Models to extract precise source code context and generate accurate, concise, and complete privacy captions for Android apps, outperforming existing methods in both expert and automated evaluations.

Original authors: Vijayanta Jain, Sepideh Ghanavati, Sai Teja Peddinti, Collin McMillan

Published 2026-02-04
📖 5 min read🧠 Deep dive

Original authors: Vijayanta Jain, Sepideh Ghanavati, Sai Teja Peddinti, Collin McMillan

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you own a small bakery. You have a sign in your window that says, "We use your name and address to deliver your cake." But in the back of your shop, your recipe book (the source code) actually shows you are also collecting your customers' favorite colors and shoe sizes to guess their next order. If a customer reads the sign but not the recipe book, they might feel tricked.

In the world of mobile apps, this "sign" is called a privacy caption. It's a short sentence telling users what personal data the app collects, how it uses it, and why. The problem is that app developers often write these signs themselves. Sometimes they are too vague, sometimes they are wrong, and sometimes they forget to mention things the app is actually doing. This can get developers in trouble with regulators and make users lose trust.

The paper you shared introduces a new tool called PCapGen (Privacy Caption Generator). Think of PCapGen as a super-smart, automated translator that reads the app's "recipe book" (the source code) and writes a perfect, honest sign for the window.

Here is how PCapGen works, broken down into three simple steps using an analogy of a detective solving a mystery:

1. The Detective (The Identifier)

First, PCapGen needs to find the clues. In an app, personal information (like your location or ID) flows from one part of the code to another.

  • The Old Way: Traditional tools only looked for clues between known "start" points (like a GPS button) and known "end" points (like sending a text). If the app did something sneaky in between that wasn't on the known list, the tool missed it.
  • The PCapGen Way: This tool is like a detective who doesn't just look for known suspects. It uses a special map (called a "call graph") to follow the trail of data even if the "end" point is a new, unknown method. It traces the path of the data through the code to find exactly where it goes, even if the developers didn't label it clearly.

2. The Librarian (The Extractor)

Once the detective finds the path, they have a list of clues, but the clues are written in a secret code (called "Jimple" format) that humans can't read.

  • The Job: PCapGen acts as a librarian who takes this secret code and translates it back into the original, readable source code. It gathers all the relevant pages, chapters, and sentences where the data is being used.
  • The Magic: It doesn't just grab one sentence; it gathers the whole context. It understands that a sentence in Chapter 3 makes sense only because of a sentence in Chapter 1. This gives the next step a complete picture of the story.

3. The Storyteller (The Generator)

Now, the tool has the full story of how the app handles data. It needs to write a short, clear sentence for the user.

  • The Tool: PCapGen uses a Large Language Model (LLM)—a very advanced AI that is great at writing and understanding language.
  • The Process: Instead of just guessing, the AI reads the specific code context gathered by the librarian. It then writes a "privacy caption" that answers three questions: What data is used? How is it used? Why?
  • The Result: It produces a sentence like, "This app uses your location to show you nearby coffee shops," which is accurate, concise, and easy to understand.

Did It Work? (The Taste Test)

To see if PCapGen was any good, the researchers set up a taste test.

  • The Baseline: They had a "standard" caption generated by an AI (acting as a developer) and then checked by human experts. This was the "control group."
  • The Contest: They compared the PCapGen captions against these standard captions.
  • The Judges: They used two types of judges:
    1. Human Privacy Experts: Real people who know about privacy laws.
    2. AI Judges: Other advanced AIs asked to compare the two captions.

The Results:

  • The AI Judges loved PCapGen. They preferred the PCapGen captions over the standard ones about 76% of the time. They found PCapGen's captions to be more accurate, complete, and concise.
  • The Human Experts also preferred PCapGen, choosing it 71% of the time when asked to pick the better caption, even though they didn't always give it a higher score on a strict rating scale.
  • The Conclusion: The paper claims that PCapGen can automatically generate privacy captions that are just as good as, or better than, those written or curated by humans, without needing the developer to do extra work.

Why This Matters

The paper emphasizes that this tool helps developers who are small teams or working alone. They often don't have privacy experts on staff to write these notices. PCapGen automates the heavy lifting, reading the code directly to ensure the "sign in the window" matches the "recipe in the back," keeping users informed and developers compliant.

The researchers also shared their tools and data so others can try it out, and they plan to make the tool run on smaller computers in the future so any developer can use it on their own machine.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →