{"id":43545116,"url":"https://github.com/pointlander/txt","last_synced_at":"2026-02-03T18:42:45.345Z","repository":{"id":265947726,"uuid":"896654357","full_name":"pointlander/txt","owner":"pointlander","description":"A natural language model based on context mixing","archived":false,"fork":false,"pushed_at":"2025-01-08T19:27:42.000Z","size":1060,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T20:36:31.631Z","etag":null,"topics":["machine-learning","self-attention","statistics"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pointlander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-01T00:00:25.000Z","updated_at":"2025-01-08T19:27:46.000Z","dependencies_parsed_at":"2025-01-08T20:34:40.494Z","dependency_job_id":"2036cad4-94b4-48ab-9579-0ea2446ef9f7","html_url":"https://github.com/pointlander/txt","commit_stats":null,"previous_names":["pointlander/txt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pointlander/txt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Ftxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Ftxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Ftxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Ftxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pointlander","download_url":"https://codeload.github.com/pointlander/txt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointlander%2Ftxt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29053103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","self-attention","statistics"],"created_at":"2026-02-03T18:42:44.641Z","updated_at":"2026-02-03T18:42:45.340Z","avatar_url":"https://github.com/pointlander.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\nThis project implements a language model by using contexts and [context mixing](https://en.wikipedia.org/wiki/Context_mixing) to produce an embedding vector.\nEach context is a histogram containing the symbol counts found in a circular symbol buffer.\nThere are eight contexts with circular buffer sizes: 1, 2, 4, 8, 16, 32, 64, and 128 which are fed with 8 bit symbols.\nContext mixing is performed with [self attention](https://arxiv.org/abs/1706.03762).\nThe eight histogram contexts are compressed down to a single embedding vector and then associated with the next symbol.\n[Nearest neighbor](https://en.wikipedia.org/wiki/Nearest_neighbor_search) is used for inferring the next symbol for a given embedding.\n## Mixer\n```go\n// Mix mixes the histograms\nfunc (m Mixer) Mix() [256]byte {\n\tmix := [256]byte{}\n\tx := NewMatrix(256, Size)\n\tfor i := range m.Histograms {\n\t\tsum := 0.0\n\t\tfor _, v := range m.Histograms[i].Vector {\n\t\t\tsum += float64(v)\n\t\t}\n\t\tfor _, v := range m.Histograms[i].Vector {\n\t\t\tx.Data = append(x.Data, float64(v)/sum)\n\t\t}\n\t}\n\ty := SelfAttention(x, x, x).Sum()\n\tsum := 0.0\n\tfor _, v := range y.Data {\n\t\tsum += v\n\t}\n\tfor i := range mix {\n\t\tmix[i] = byte(128 * y.Data[i] / sum)\n\t}\n\treturn mix\n}\n```\n# Usage\nClone the repo and then:\n```sh\ngo build\n```\nTo build the vector database (1.1GB):\n```sh\n./txt -build\n```\nTo query the vector database using nearest neightbor\n```sh\n./txt -brute -query \"God\"\n```\nTo query the vector database using approximate nearest neighbor:\n```sh\n./txt -query \"God\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointlander%2Ftxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpointlander%2Ftxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointlander%2Ftxt/lists"}