Skip to content
mitkoxPublic

About

Local AI implementation of Large-scale online deanonymization with LLMs

Resources

Stars

13 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

AIMatch (Reference Implementation)

This repository contains a dependency-free, local implementation of an AIMatch-style pipeline based on the ESRC structure from the paper:

  • Extract: normalize each profile into compact tags/fingerprint text.
  • Search: retrieve top-k candidate profiles with TF-IDF cosine similarity.
  • Reason: compare shortlisted candidates and select match or abstain.
  • Calibrate: produce confidence scores via direct confidence or Swiss-style pairwise ranking.

GitHub repository: https://github.com/mitkox/aimatch

Install

python3 -m pip install -e .

Input format

queries.jsonl and candidates.jsonl accept rows like:

{"id":"q1","texts":["post 1","post 2"],"metadata":{"source":"x"}}

Ground truth rows:

{"query_id":"q1","candidate_id":"c42"}

For non-match queries, set "candidate_id": null.

Run

aimatch run \
  --queries examples/synthetic/queries.jsonl \
  --candidates examples/synthetic/candidates.jsonl \
  --output /tmp/predictions.jsonl \
  --ground-truth examples/synthetic/ground_truth.jsonl \
  --calibration swiss

Run With Local vLLM (mitko on localhost:8000)

If your vLLM server exposes the OpenAI-compatible API at http://localhost:8000/v1:

aimatch run \
  --queries examples/synthetic/queries.jsonl \
  --candidates examples/synthetic/candidates.jsonl \
  --output /tmp/predictions_llm.jsonl \
  --use-local-llm \
  --llm-max-concurrency 8 \
  --activity-log \
  --activity-log-every 10 \
  --llm-base-url http://localhost:8000/v1 \
  --llm-model mitko

If your server requires an API key, also pass --llm-api-key .... Activity logs are printed to stderr so they remain visible while output is still written normally.

For faster runs with fewer LLM calls, use heuristic extraction and LLM only for reasoning:

aimatch run \
  --queries examples/synthetic/queries.jsonl \
  --candidates examples/synthetic/candidates.jsonl \
  --output /tmp/predictions_reason_llm.jsonl \
  --extractor-backend heuristic \
  --reasoner-backend llm \
  --llm-base-url http://localhost:8000/v1 \
  --llm-model mitko \
  --llm-max-concurrency 8 \
  --activity-log

Evaluate

aimatch eval \
  --predictions /tmp/predictions.jsonl \
  --ground-truth examples/synthetic/ground_truth.jsonl \
  --target-precision 0.95

Notes

  • This implementation is designed for reproducibility and extension, not production-scale retrieval.
  • Heuristic extract/reason is the default; LLM-backed extract/reason is available via CLI flags.
  • Use only with data you are authorized to process.

License

MIT. See LICENSE.

About

Local AI implementation of Large-scale online deanonymization with LLMs

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages