Papers › A Structured Self-attentive Sentence Embedding

A Structured Self-attentive Sentence Embedding

9 Mar 2017arXiv:1703.03130archive 2025-07-28

Zhouhan Lin, Minwei Feng, Cicero Nogueira dos santos, Mo Yu, Bing Xiang, Bo-Wen Zhou, Yoshua Bengio

This paper proposes a new model for extracting an interpretable sentence embedding by introducing self-attention. Instead of using a vector, we use a 2-D matrix to represent the embedding, with each row of the matrix attending on a different part of the sentence. We also propose a self-attention mechanism and a special regularization term for the model. As a side effect, the embedding comes with an easy way of visualizing what specific parts of the sentence are encoded into the embedding. We evaluate our model on 3 different tasks: author profiling, sentiment classification, and textual entailment. Results show that our model yields a significant performance gain compared to other sentence embedding methods in all of the 3 tasks.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1703.03130")

Code

Syntology Ran 4 of 10 code samples harvested from 5 repositories linked to this paper; 6 have no recorded run. Of those that ran: 4 ran · our draft was wrong.

By repository: community (archive-listed): 10 samples from 5 repositories, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

52 repositories listed; official and paper-mentioned ones first.

CenIII/WSNet mentioned on GitHubpytorch report
HearyShen/HAN-SelfAttentive mentioned on GitHubtf report
HiJiGOO/self-attentive mentioned on GitHubtf report
Lemoners/Attention-Is-All-You-Need mentioned on GitHubpytorch report
MFajcik/RumourEval2019 mentioned on GitHubpytorchNOASSERTION report
MohamedAbdelsalam9/TT-Transformer mentioned on GitHubpytorch report
Neoanarika/torchexplainer mentioned on GitHubpytorch report
OPAYA/Transformer mentioned on GitHubpytorch report
SeoroMin/transformer_pytorch mentioned on GitHubpytorch report
SeoroMin/transformer_pytorch_ver2 mentioned on GitHubpytorch report
Tao-Mind/QDD_Net mentioned on GitHubtfMIT report
TieDanCuihua/A-STRUCTURED-SELF-ATTENTIVE-SENTENCE-EMBEDDING mentioned on GitHubtfnot reachable when probed 2026-09-18 — repositories for recent papers often appear after camera-ready report
ZmeiGorynych/transformer_pytorch mentioned on GitHubpytorch report
anirudharc/transformer mentioned on GitHubpytorch report
celsolbm/Attention_Text mentioned on GitHubpytorch report
celsolbm/imdb_sentiment_experiments mentioned on GitHubpytorch report
dataflowr/self-attentive-sentence-embedding mentioned on GitHubpytorchApache-2.0 report
dhesenkamp/attentive-lstm mentioned on GitHubtfMIT report
esadsetts/Mod_4_project mentioned on GitHubmxnet report
facebookresearch/pytext mentioned on GitHubpytorchNOASSERTION report
hantek/SelfAttentiveSentEmbed mentioned on GitHubpytorchApache-2.0 report
kalaivani-s/self-attentive-sent-emb mentioned on GitHubpytorch report
kaushalshetty/Structured-Self-Attention mentioned on GitHubpytorch report
kenkenling/NLP mentioned on GitHubpytorch report
laohur/LearnToCompareText mentioned on GitHubpytorch report
laohur/RelationNet mentioned on GitHubpytorch report
leejieun51/transformer mentioned on GitHubpytorch report
liqichen6688/duo-attention mentioned on GitHubpytorch report
natel9178/transformer-refork mentioned on GitHubpytorch report
paddorch/SelfAttnSent.paddle mentioned on GitHubpaddleApache-2.0 report
prakashpandey9/Text-Classification-Pytorch mentioned on GitHubpytorchMIT report
roomylee/self-attentive-emb-tf mentioned on GitHubtfMIT report
shijx12/AR-Tree mentioned on GitHubpytorch report
simonjisu/nsmc_study mentioned on GitHubpytorch report
text-machine-lab/transformerpy mentioned on GitHubpytorch report
warnikchow/coaudiotext mentioned on GitHubtfMIT report
willzli/bilstm_selfattention mentioned on GitHubpytorch report
xalanq/chinese-sentiment-classification mentioned on GitHubpytorch report
yanqi1811/attention-is-all-you-need mentioned on GitHubpytorch report
yueyongjiao/Transformer-Contextual mentioned on GitHubpytorch report
yuriak/PPDAI mentioned on GitHubtf report
zhangbo2008/best_pytorch_transformer mentioned on GitHubpytorch report
dmlc/gluon-nlp mxnetApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 4 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · our draft was wrong
6unverified

Licence: 2 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 5 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

clean_str roomylee/self-attentive-emb-tf/data_helpers.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · efe1a86fd9a2468e · report
json_to_dict kaushalshetty/Structured-Self-Attention/classification.py community (archive-listed) ran · our draft was wrong MIT (permissive) · ecc1307775a708aa · report
string_parser HiJiGOO/self-attentive/code/self-attentive.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 5e9d3d663b78a270 · report
token_parse HiJiGOO/self-attentive/code/self-attentive.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 39e95d3164e07875 · report
F_score paddorch/SelfAttnSent.paddle/self_attn_sent/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · da3b18d772dc8f1f · report
cho2onehot warnikchow/coaudiotext/han2one.py community (archive-listed) unverified MIT (permissive) · 4f425858112c1b43 · report
con2onehot warnikchow/coaudiotext/han2one.py community (archive-listed) unverified MIT (permissive) · b4b9fac0046d2067 · report
cwu2onehot warnikchow/coaudiotext/han2one.py community (archive-listed) unverified MIT (permissive) · 166e995944ac3cdb · report
load_data_and_labels roomylee/self-attentive-emb-tf/data_helpers.py community (archive-listed) unverified MIT (permissive) · 27e5a1edfa3a516d · report
precision_recall paddorch/SelfAttnSent.paddle/self_attn_sent/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · c01024271e313d54 · report

Tasks

Author ProfilingGeneral ClassificationNatural Language InferenceSentenceSentence EmbeddingSentence-EmbeddingSentiment AnalysisSentiment Classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections