HackerPapers

arXiv:2212.09410cs.CL

Less is More: Parameter-Free Text Classification with Gzip

Zhiying Jiang, Matthew Y. R. Yang, Mikhail Tsirlin, Raphael Tang, Jimmy Lin

Abstract

Deep neural networks (DNNs) are often used for text classification tasks as they usually achieve high levels of accuracy. However, DNNs can be computationally intensive with billions of parameters and large amounts of labeled data, which can make them expensive to use, to optimize and to transfer to out-of-distribution (OOD) cases in practice. In this paper, we propose a non-parametric alternative to DNNs that's easy, light-weight and universal in text classification: a combination of a simple compressor like gzip with a $k$-nearest-neighbor classifier. Without any training, pre-training or fine-tuning, our method achieves results that are competitive with non-pretrained deep learning methods on six in-distributed datasets. It even outperforms BERT on all five OOD datasets, including four low-resource languages. Our method also performs particularly well in few-shot settings where labeled data are too scarce for DNNs to achieve a satisfying accuracy.

arXiv comments
Journal reference
DOI
Subjects
cs.CLComputation and Language

On Hacker News

Linked by 4 identifiable commenters in 4 comments across 4 threads, from Jul 2023 to Sep 2026.

Comments linking this paper, per year.

Discussed in comments4 threads

  1. Can gzip be a language model? 1 comment
    • There is an older paper that also looks at gzip for ML: https://arxiv.org/abs/2212.09410 Video from tsoding where he implements the algorithm: https://www.youtube.com/watch?v=9n39SbRPXKQ

      teh64View on HNParent context

    • This is interesting, but why don’t they link to the paper? Or at least give its title? The paper is «“Low-Resource” Text Classification: A Parameter-Free Classification Method with Compressors»: ACL Anthology, has PDF link: https://aclanthology.org/2023.findings-acl.426/ Arxiv…

      AlbertoGPView on HNParent context

    • Compression based ML approaches and hacks are fascinating. My colleague recently sent me this: https://arxiv.org/abs/2212.09410 "Less is More: Parameter-Free Text Classification with Gzip "...We propose a non-parametric alternative to DNNs that's easy, light-weight and universal…

      bravuraView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.