Show HN: Talk to any ArXiv paper just by changing the URL (github.com)
Hello HN, Talk2Arxiv is a small open-source RAG application I've been building for a few weeks. To use it just prepend any arxiv.org link with 'talk2' to load the paper into a responsive RAG chat application (e.g. www.arxiv.org/abs/1706.03762 -> www.talk2arxiv.org/abs/1706.03762).
All implementation details are in the GitHub. Currently, because I've opted to extract text from the PDF of the paper rather than reading the LaTeX source code (since I wanted to build a more generic PDF RAG in the process), it struggles with symbolic text / mathematics, and sometimes fails to retrieve the correct context. I appreciate any feedback, and hope people find it useful!
Currently, the backend PDF processing server is only single-threaded so if embedding takes a while please be patient!
77 comments
[ 6.9 ms ] story [ 162 ms ] threadEven though it gave a lot of great structured options, missing even a single sentence was unforgivable to me. I went with Nougat instead, for arxiv papers.
(Also check out Marker (mentioned on hn in the last month) for pretty high fidelity paper conversion to markdown. Does reasonable job with equations too.)
The chunking algorithm chunks by logical section (intro, abstract, authors, etc.) and also utilizes recursive subdivision chunking (chunk at 512 characters, then 256, then 128...). It is quite naive still but it works OK for now. An improvement would perhaps involve more advanced techniques like knowledge graph precomputation.
Reranking works by instead of embedding each text chunk as a vector and performing cosine similarity nearest neighbor search, you use a Cross-Encoder model that compares two texts and outputs a similarity score. Specifically, I chose Cohere's Reranker that specializes in comparing Query and Answer chunk pairs.
Consider something like phpbb. There are thousands of instances in the world, all with similar URLs. You might have some management script or bookmarks that rely on this URL structure and you can just change the domain name to use them on a new site.
Ditto for discovering historical blog posts on a wordpress site. Or interacting with a Stack Overflow.
Blocked in the UK :(
javascript:((u,a,b,c)=%3Ewindow.location.href=u.match(a)?u.replace(a,b):u.startsWith(b)?u.replace(b,c):u)(window.location.href,/https:\/\/arxiv\.org\/(abs|pdf)\//,'https://www.talk2arxiv.org/pdf/','https://arxiv.org/pdf/')
Using that might be easier than a multi-modal approach. Bonus points for:
* Multiple papers at once
* Comparing PDF and HTML output with the LLM as input for it correcting similar converter code
Both are tools to convert pdfs into Latex or Markup with latex formulas. Maybe that helps
"Relying on autoregressive forward passes to generate text is slow and prone to hallucination/repetition. From the nougat paper: We observed [repetition] in 1.5% of pages in the test set, but the frequency increases for out-of-domain documents. In my anecdotal testing, repetitions happen on 5%+ of out-of-domain (non-arXiv) pages."
When these are fed in the next levels as inputs, isn't it even less surprising to get even more hallucinations/repetitions?
https://learn.microsoft.com/en-us/azure/ai-services/document...
Used it to scope/isolate databases storing backups to a shared storage account
https://ollama.ai/blog/building-llm-powered-web-apps
There's also Cheshire Cat, which is a framework for building chat assistants that use a set of documents as a knowledge base:
https://github.com/cheshire-cat-ai/core
I assume I'm just getting old and have a limited imagination when it comes to these new AI things.
Anyone got any good examples on how to effectively use this?
The things I might be able to phrase into query is not something I trust the AI to be able to explain, like what are the downsides of the proposed algorithm for example (unless explicitly mentioned, which is seldom).
I guess I'll have to try to keep this project in mind next time I read an arXiv article, and give it a spin.
"I'm building xyz app, how could this be applicable?"
"I want to know if x or y, what does this paper say, or does it even apply?"
"Implement the pseudocode algorithm in python"
"Can you help me understand section X, the wording is tricky"
"Doesn't this suffer from {flaw}?"
"How does the paper address x?"
No, an AI will not give 100% perfect answers all of the time. You know who else? Humans. You already have mechanisms to deal with unreliability, so please save yourself time and use AI to be more efficient.
The query pipeline isn't that sophisticated, but it could be altered to do page reference and use keyterms first to filter, instead of doing the vector similarity on all data.
One thing with MittaAI is that it doesn't do UI interfaces. It expects you to handle those bits.