BackgroundThe early accurate diagnoses for autoimmune encephalitis (AE) and infectious encephalitis (IE) are essential since the treatments for them are different. This study aims to discover some specific and sensitive biomarkers to distinguish AE from IE at early stage to give specific treatments for good outcomes.ResultsWe compared the host gene expression profiles and microbial diversities of cerebrospinal fluid (CSF) from 41 patients with IE and 18 patients with AE through meta-transcriptomic sequencing. Significant differences were found in host gene expression profiles and microbial diversities in CSF between patients with AE and patients with IE. The most significantly upregulated genes in patients with IE were enriched in pathways related with immune response such as neutrophil degranulation, antigen processing and presentation and adaptive immune system. In contrast, those upregulated genes in patients with AE were mainly involved in sensory organ development such as olfactory transduction, as well as synaptic transmission and signaling. Based on the differentially expressed genes, a classifier consisting of 5 host genes showed outstanding performance with an area under the receiver operating characteristic (ROC) curve (AUC) of 0.95.ConclusionsThis study provides a promising classifier and is the first to investigate transcriptomic signatures for differentiating AE from IE by using meta-transcriptomic next-generation sequencing technology.Supplementary InformationThe online version contains supplementary material available at 10.1186/s13578-023-01047-x.