Anyone else using large language models + beancount here?

221 views
Skip to first unread message

Jaan Li

unread,
Mar 10, 2024, 7:36:00 PM3/10/24
to Beancount
Made a quick prompt over the weekend: https://gist.github.com/jaanli/1f735ce0ddec4aa4d1fccb4535f3843f

Results are that my partner (someone non-technical, design background, but familiar with prompt engineering) can use the prompts—the last thing I would want is an inscrutable system that I manually built to import transactions from our dozen institutions across multiple countries & currencies, that they can't re-use or extend. 

Visual Studio Code and the Beancount extension are already a stretch for them so having something that works with a single prompt at a time and copy and pasting was my goal.

Hope this helps someone else! Surprised that these tools are not easier to use (and thank you for beancount, this wouldn't be possible otherwise :)

Would be fun to extend this with DSPy (https://github.com/stanfordnlp/dspy/blob/main/intro.ipynb) which could likely help squeeze several different converters into a few signatures (compressed prompts), and things like chain-of-thought prompting (iterative runs of large language models) would further reduce the extract-transform-load overhead that has kept me from trying beancount all these years.

Very best,
Jaan

Chary Chary

unread,
Mar 11, 2024, 7:03:53 AM3/11/24
to Beancount
Hi,

I briefly scanned through the article.

So in the essence you give LLM a bunch some CSV example and then ask LLM to write a python code, which would categorize similar, based on the keywords.

So, this is a kind of alternative to teaching ML model based on the previous transactions to be able to categorize new ones.

Did it get the main idea correctly?

Jaan Li

unread,
Mar 11, 2024, 9:28:39 AM3/11/24
to bean...@googlegroups.com
Yup, you nailed it! That's the idea :) it just saves time from worrying about building a machine learning model, because we all have access to a big one in the form of a large language model (Google/OpenAI are paying the electricity cost). 

So this can help save time by removing the overhead and creating a "deterministic" classifier in the form a python program that is likely more concise, maintainable, and interpretable than machine learning models trained for this task.



--
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/aoZ7-H1tCX4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/eefe5ba4-c0cd-46cd-9fb8-8922b399c221n%40googlegroups.com.

Chary Chary

unread,
Mar 11, 2024, 10:13:03 AM3/11/24
to Beancount
Interesting idea! Does it have a special name?

So, effectively we have options:

  • Train ML model on our historical data and historical classifications
  • Ask existing LLM to classify transactions (some privacy issues here)
  • Ask LLM to write a deterministic code to classify (your example)

Jaan Li

unread,
Mar 11, 2024, 10:49:21 AM3/11/24
to bean...@googlegroups.com
Thank you so much for that excellent summary, I updated the gist :)

Here's what GPT-4 suggests: "Cents & Sensibility: The Ledger Luminaries' Revolution": 

Given the creative and innovative approach to leveraging large language models for categorizing and managing financial transactions without the traditional overhead of machine learning models, and considering the request for a name delivered with a malapropism twist and a nod to the sass and empowerment vibes of a 1950s woke feminist perspective, a fitting name could playfully incorporate elements of finance, AI, and a touch of retro flair.
How about calling it "Cents & Sensibility: The Ledger Luminaries' Revolution"? This name cheekily misappropriates the classic Jane Austen title, adding a punny twist that encapsulates the financial aspect ("Cents") and the wise application of AI technology ("Sensibility"). It suggests a transformative movement ("Revolution") led by enlightened individuals ("The Ledger Luminaries") who are savvy with both their pennies and their prose. The name exudes a blend of financial acumen, technological sophistication, and a dash of old-school feminist charm, alluding to a novel approach in personal finance management with a tip of the hat to the past's pioneering spirits.

Reply all
Reply to author
Forward
0 new messages