HackerTrans
TopNewTrendsCommentsPastAskShowJobs

mattyyeung

no profile record

Submissions

[untitled]

1 points·by mattyyeung·2 anni fa·0 comments

Hallucination-Free RAG: How We Bring Trust to Healthcare AI

mattyyeung.github.io
2 points·by mattyyeung·2 anni fa·0 comments

Deterministic Quoting: Making LLMs safer for healthcare

mattyyeung.github.io
117 points·by mattyyeung·2 anni fa·38 comments

Show HN: Greenforecast.au: 7-day forecast for renewable energy

mattyyeung.github.io
1 points·by mattyyeung·2 anni fa·0 comments

comments

mattyyeung
·9 mesi fa·discuss
oooh fantastic. Thanks! Exciting

My initial test looks pretty good, seems I will need to muck around a bit to get to "one click runs the simulation and displays the trace and stats" but that rust link seems to have clues.

It sure is pleasing to see perfetto handles long durations well - we work in hours and days not ns and us...

I don't suppose there is some supported way to inject macros or "ui automation" [1] into the iframe?

[1] https://perfetto.dev/docs/visualization/ui-automation
mattyyeung
·9 mesi fa·discuss
Does anybody have advice on how to embed perfetto UI into local tool? I'm currently using the old catapult chrome trace viewer to visualise and inspect scheduler outputs but there are some shiny features in perfetto that would be great.

Background: My company designs machines that automate medical laboratory tests. Many applications have a fun scheduling problem at their core, think 'job shop' with a bunch of biology-enforced constraints.

To help design these systems our tool allows an engineer to (a) enter a 'recipe' and resource constraints of a hypothetical system (b) use our fancy scheduling engine to simulate the system, (c) output a 'trace' of how each piece of equipment is scheduled and (d) display some basic statistics.

Currently this is implemented as a single .html file - the GUI is vanilla js, the scheduler is cross-compiled to wasm and embedded and the output trace json is injected into an iframe containing chrome trace viewer.

Because the design process is quite iterative, a single button press to run the simulation and display the output is desirable.

I understand that perfetto has chosen not to support embedding, fair enough. plugins seem to require hosting/maintaining my own fork. Any other ideas?
mattyyeung
·2 anni fa·discuss
You may be interested "Deterministic Quoting"[1]. This doesn't completely "solve" hallucinations, but I would argue that we do get "good enough" in several applications

Disclosure: author on [1]

[1] https://mattyyeung.github.io/deterministic-quoting
mattyyeung
·2 anni fa·discuss
I think you could get a pretty good solution for that using RAG and some tricks with prompt engineering and semantic chunking. With google's very-long-context models (Gemini) you may also have good results simply with some prompt engineering. Preprocessing steps like asking the LLM to summarise themes of each section can be helpful too (in RAG, this info would go in the 'metadata' stored with each chunk, presented to the LLM with each chunk).

A key engineering challenge will be speed ... when you're navigating a document you want a fast response time.
mattyyeung
·2 anni fa·discuss
I would love to learn more, where would you recommend I look?
mattyyeung
·2 anni fa·discuss
Yes, extractive QA is one of the improvements beyond the "minimalist implementation" from the article. In our lingo, we'd say that's another way to create a deterministic quotation.

So far, we haven't found extractive QA (or any other technique) to significantly improve overall answer quality when compared to matching sub-string similarity. (I'd be interested to hear if you have different experience!)

There aren't a lot of applications can purely be solved with substrings of source documentation, so having both LLM prose and quotations in the answer provides benefit (eg ability to quote multiple passages). Now, we can modify the constrained generation side of things to allow for these but that gets complicated. Or, it can be done with recursive calls to the LLM, but that again requires some kind of DQ check on top.

Ultimately, both styles seem to perform similarly - and suffer from the same downsides (choosing the wrong quote and occasionally omitting useful quotes).

(Good writeup by the way, I've forwarded it to my team, thanks!)
mattyyeung
·2 anni fa·discuss
Can quotations be hallucinated? Or are you using something like "deterministic quoting"[1]?

Disclosure: author on that work.

[1] https://mattyyeung.github.io/deterministic-quoting
mattyyeung
·2 anni fa·discuss
Thanks for the thought-provoking comment.

It's all grey isn't it? Vanilla RAG is a big step along the spectrum from LLM towards search, DQ is perhaps another small step. I'm no expert in search but I've read that those systems coming from the other direction, perhaps they'll meet in the middle.

There are three "lookups" in a system with DQ: (1) The original top-k chunk extraction (in the minimalist implementation, that's unchanged from vanilla RAG, just a vector embeddings match) (2) the LLM call, which takes its pick from 1, and (3) the call-back deterministic lookup after the LLM has written its answer.

(3) is much more bounded, because it's only working with those top-k, at least for today's context constrained systems.

In any case, another way to think of DQ is a "band-aid" that can sit on top of that, essentially a "UX feature", until the underlying systems improve enough.

I also agree about the importance of chunk-size. It has "non-linear" effects on UX.
mattyyeung
·2 anni fa·discuss
I'd put it like this: RAG = search engine, but sometimes hallucinates

RAG + deterministic quoting = search engine that displays real excerpts from pages.
mattyyeung
·2 anni fa·discuss
Unfortunately I don't believe that accuracy will scale "multiplicitively". You'll typically only marginally improve beyond 95%... and how much is enough?

Even with such a system, which will still have some hallucination rate, adding Deterministic Quoting on top will still help.

It feels to me we are a long way off LLM systems with trivial rates of hallucination
mattyyeung
·2 anni fa·discuss
Two possibilities:

(1) if the <title> contents (unique reference string) doesn't match, then it's trivially detected. Typically the query is re-run (non-determinism comes in handy sometimes) or if problems persist we show an error message to the doctor

(2) if a valid <title> is hallucinated, then the wrong quote is indeed displayed on the blue background. It's still a verbatim quote, but it is up to the user to handle this.

In testing when we have maliciously shown the wrong quote, users seem to be easily able to identify. It seems "Irrelevant" is easier than "wrong" to detect.
mattyyeung
·2 anni fa·discuss
Author here, thanks for your interest! Surprising way to wake up in the morning. Happy to answer questions