HNHacker News
TopNewBestAskShowJobs

zh217

506 karma · joined September 21, 2016

submissionscomments
zh217··on Show HN: Llama2 Embeddings FastAPI Server
OpenAI's embedding API has an undocumented flag 'encoding_format': 'base64' which will give you base64-encoded raw bytes of little-endian float32. As it is used by the official python client, it is unlikely to go away.
zh217··on Function calling and other API updates
Some observations:

1. their usage page is currently broken, showing only the usage of the new models and the embedding models. usage for the deprecated models are not included now.

2. because of 1, it can be seen on the usage page that if you have set your model name to 'gpt-4' instead of the versioned name in your calling code (same for 3.5), you have already been using the new models for the past two days!

zh217··on RWKV: Reinventing RNNs for the Transformer Era
This sounds pretty bad, right? Since their model is way smaller than SOTA transformers (and small size is one of their selling points).
zh217··on I stopped worrying and learned to love denormalized tables
Maybe "Impedance Mismatch"?
zh217··on Bard now open to use

    > Tell me more about Trump
    
    As a language model, I'm not able to assist you with that.
    
    > Tell me more about Biden
    
    Joseph Robinette Biden Jr. (born November 20, 1942) is an American politician who is the 46th and current president of the United States. A member of the Democratic Party, he previously served as the 47th vice president from 2009 to 2017 under President Barack Obama and represented Delaware in the United States Senate from 1973 to 2009 ...
zh217··on Dromedary: Principle-Driven Self-Alignment of Language Models
Summary: Dromedary is an AI assistant developed using the SELF-ALIGN approach, which combines principle-driven reasoning and the generative power of large language models for self-alignment with minimal human supervision. Dromedary is based on the LLaMA-65b language model and outperforms several state-of-the-art AI systems on benchmark datasets with various settings. With fewer than 300 lines of human annotations, Dromedary can generate helpful, ethical, and reliable responses to user queries.
zh217··on What is a Vector Database? (2021)
For me personally the most important motivations are to have recursive queries using vector search, and to integrate graphs and vectors. Obviously I need to implement my own, as none of the other vector stores have it. And the fact that the HNSW index is just a bunch of graphs certainly makes it very appealing for a graph database to have it, as once you have your data indexed, proximity searches are just walks on graphs, so you don't even need to touch the vectors again!
zh217··on What is a Vector Database? (2021)
If anyone wants to try a FOSS vector-relational-graph hybrid database for more complicated workloads than simple vector search, here it is: https://github.com/cozodb/cozo/

About the integrated vector search: https://docs.cozodb.org/en/latest/releases/v0.6.html

It also does duplicate detection (Minhash-LSH) and full-text search within the query language itself: https://docs.cozodb.org/en/latest/releases/v0.7.html

HN discussion a few days ago: https://news.ycombinator.com/item?id=35641164

Disclaimer: I wrote it.

zh217··on Show HN: GPT-JSON – Structured and typehinted GPT responses in Python
Another alternative JSON parser is the YAML parser. YAML is a superset of JSON and deals with a lot more weird cases, notably capital True and False.
zh217··on Show HN: GPT-JSON – Structured and typehinted GPT responses in Python
Thanks. Out of all the suggestions in the comments for this post, this one works the best.

And in fact it is only one line, not 40:

    "Please respond ONLY with valid json that conforms to this pydantic json_schema: {model_class.schema_json()}. Do not include additional text other than the object json as we will load this object with json.loads() and pydantic."
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Thanks! I'm really glad that you find CozoDB useful!
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Sorry about that ... I will revise it to be more consistent. Cozo is a bit ambiguous, so now it is usually called CozoDB.
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
The linked article explains these in details.
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Yes, actually I already do that. Sbert is better than openai ada embeddings for many use cases.
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
They need to be put into distinct indices and unfortunately you cannot “jump” between them in this case (if someone knows a way to achieve this, I would love to hear!)
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
I have been thinking about adding FTS to CozoDB for a long time but resisted the temptation so far. The reason is that text search is language-specific: what works for one language does not work for another. There is simply no way that CozoDB can duplicate the work of a dedicated text search engine for all the languages in the world.

Our current solution is to use mutation callbacks to synchronize texts to a dedicated text search engine. This is language specific: for example, for python: https://github.com/cozodb/pycozo#mutation-callbacks , and for Rust: https://docs.rs/cozo/latest/cozo/struct.Db.html#method.regis...

zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Great questions!

- As can be seen https://docs.cozodb.org/en/latest/releases/v0.3.html, for concurrent writes about 200K QPS can be achieved with 24 threads on a pretty old server. I think it is enough for a small to medium social network.

- You can start independent instances and use them together in your user code. You can have as many as you like, but data can only be exchanged through your code: they can't talk directly to each other.

- If by git-like you mean point-in-time queries, yes that's what the feature is for. But git comes with lots of other things such as merge logic, etc. These need to be implemented outside CozoDB.

- We do use CozoDB for data storage in production systems ourselves, and we back up a lot. So far nothing disastrous has happened. Note that CozoDB does not have any meaningful concept of user/authentication/authorization (yet), so you must make sure that only trusted clients can reach it (only an issue if you use the standalone server, since the embedded DBs do not open any ports).

zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Wow, cellular sheaves, that's a connection I haven't thought of before!
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Thank you!
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Thanks for the suggestion--will surely do that!
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
For the parquet question: currently CozoDB is developed by a single developer (me), but I am starting to explore ways of expanding the development team. Certainly a lot more features will be added if that happens, and parquet support looks like a really useful one.
zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Yes this is correct, only the query's answer set need to be in memory. We are also working on streaming for the Rust API, in which case you don't even need to keep the whole set in memory for simple queries.

FYI here is a not very rigourous performance and memory usage analysis (for a previous version without the vector search capability): https://docs.cozodb.org/en/latest/releases/v0.3.html

zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
Not for the moment, it is not polished enough. Right now it is just a webapp written in React and prosemirror running on top of a CozoDB instance. And it is very rough around the edges (good enough for myself, but maybe not for others).

Once local LLMs that are powerful enough become available, though, I think I will try to find time to polish and publish it, since it can then act as a showcase for what a thinking agent can achieve.

zh217··on Show HN: CozoDB, Hybrid Relational-Graph-Vector Database
I'm not too familiar with rel, but from what I read, rel seems to be cloud only, and CozoDB always aims to be local-first. Another difference is that CozoDB has many whole-graph algorithms, and more can be added from user code (for example using Python), which I don't see rel having.
zh217··on Alpaca: A strong open-source instruction-following model
Also today: ChatGLM released by Tsinghua University. I've made a separate submission for it: https://news.ycombinator.com/item?id=35150190

The GitHub page is https://github.com/THUDM/ChatGLM-6B. The GitHub description is all in Chinese, but the model itself can handle English queries on a single consumer GPU well. Considering its size, I'd say the quality of its responses are outstanding.

zh217··on ChatGLM, a ChatGPT-like LLM developed by Tsinghua Univ, runnable on consumer GPU
The project description is in Chinese, so I've used the Google translate URL for this submission.

The GitHub page for the project is https://github.com/THUDM/ChatGLM-6B

I've tried the model on my own machine, the quality is outstanding for both English and Chinese.

zh217··on Introduction to Datalog
Another problem with Clojure-based Datalog is performance. Yet another is you are pretty much tied to the Clojure ecosystem. And I don't really like the Clojure-fused Datalog syntax either. These pains spurred me to write my own: https://docs.cozodb.org/en/latest/ (FOSS), and so far I'm satisified with my own work.
zh217··on Computational Foundations for the Second Law of Thermodynamics
I spent ten minutes reading this and lost interest. Everything he explains in the beginning of this article is obvious or common sense (common sense for anyone who has a physics degree, that is) and I am not sure where the "new" things he discovered begin. There is a reason that academic papers are required to have an abstract, an introduction section and a conclusion section. Unfortunately Mr Wolfram seems to think that his endless rambling can convey scientific discovery better.
zh217··on PRQL: a simple, powerful, pipelined SQL replacement
I think you should try Datalog, or a flavour of it called Cozo: https://docs.cozodb.org/en/latest/

Disclaimer: I wrote Cozo.

zh217··on Asami: A flexible graph store in Clojure
What you described can be implemented efficiently with B-trees. The problem is, the required operation is low-level and not usually exposed by the database engines. Basically you need to be able to walk the tree, up and down.

Say your table is `[data, timestamp]`, with data sorted ascendingly and timestamp sorted descendingly in the tree, and you want to scan for values for `as_of(T)`. Assume you have found `[data1, T1]` as a valid row. To get the next row, instead of the usual scanning, you seek to the value greater than `[data1, neg_inf]`. Now assume the value you get for the seek is `[data2, T2]`. If `T2 <= T`, then you get a match and can continue with the loop by seeking to `[data2, neg_inf]`, otherwise seek to `[data2, T]` and see what you get.

It is doable in SQLite, but you must use its VM directly, as you cannot do tree-walking with SQL.

Assume you have `M` keys and that for every key you have `N` timestamped data points. The above algorithm cuts down the as-of query time from linear complexity in `N` (`MN log(M)`) to logarithmic complexity in `N` (`M log(MN)`), which I think is the best we can do.

Page 1 of 2Next →