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 View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 10 code samples harvested from 5 repositories linked to this paper: 10 ran (of which 0 constructed an object rather than computing a result; 6 with no instrument failure: 0 honoured, 0 violated, 6 with no contract checked; 4 where Syntology's instrument failed) · 0 unverified. Where Syntology's instrument failed: 4 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 10 samples from 5 repositories, 10 ran (6 with no instrument failure; 4 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 12 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

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

CenIII/WSNet mentioned on GitHubpytorchSyntology: not harvested report
ExplorerFreda/Structured-Self-Attentive-Sentence-Embedding mentioned on GitHubpytorchGPL-3.0Syntology: not harvested report
HearyShen/HAN-SelfAttentive mentioned on GitHubtfSyntology: not harvested report
HiJiGOO/self-attentive mentioned on GitHubtfSyntology: 2 samples, 2 ran (2 instrument-failed) · 0 unverified report
Kailianghu/A-Structured-Self-Attentive-Sentence-Embedding mentioned on GitHubpytorchGPL-3.0Syntology: not harvested report
Lemoners/Attention-Is-All-You-Need mentioned on GitHubpytorchSyntology: not harvested report
MFajcik/RumourEval2019 mentioned on GitHubpytorchNOASSERTIONSyntology: not harvested report
MohamedAbdelsalam9/TT-Transformer mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
Neoanarika/torchexplainer mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
OPAYA/Transformer mentioned on GitHubpytorchSyntology: not harvested report
PrashantRanjan09/Structured-Self-Attentive-Sentence-Embedding mentioned on GitHubpytorchSyntology: not harvested report
Rudedaisy/attention-is-all-you-need-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
SeoroMin/transformer_pytorch mentioned on GitHubpytorchSyntology: not harvested report
SeoroMin/transformer_pytorch_ver2 mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
ShuvenduBikash/transformer_spelling_corrector mentioned on GitHubpytorchSyntology: not harvested report
Tao-Mind/QDD_Net mentioned on GitHubtfMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to QANet: Combining Local Convolution with Global Self-Attention for Reading Comprehension (arXiv:1804.09541; that paper's own run record: 14 ran (of which 0 constructed an object rather than computing a result; 10 with no instrument failure: 3 honoured, 0 violated, 7 with no contract checked; 4 where Syntology's instrument failed) · 5 unverified); nothing checks that they implement this paper's method. 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-readySyntology: not harvested report
ZmeiGorynych/transformer_pytorch mentioned on GitHubpytorchSyntology: not harvested report
anirudharc/transformer mentioned on GitHubpytorchSyntology: not harvested report
celsolbm/Attention_Text mentioned on GitHubpytorchSyntology: not harvested report
celsolbm/imdb_sentiment_experiments mentioned on GitHubpytorchSyntology: not harvested report
dataflowr/self-attentive-sentence-embedding mentioned on GitHubpytorchApache-2.0Syntology: not harvested report
dhesenkamp/attentive-lstm mentioned on GitHubtfMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Human Motion Analysis with Deep Metric Learning (arXiv:1807.11176; that paper's own run record: 8 ran (of which 0 constructed an object rather than computing a result; 8 with no instrument failure: 0 honoured, 0 violated, 8 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
esadsetts/Mod_4_project mentioned on GitHubmxnetSyntology: not harvested report
facebookresearch/pytext mentioned on GitHubpytorchNOASSERTIONSyntology: not harvested report
hantek/SelfAttentiveSentEmbed mentioned on GitHubpytorchApache-2.0Syntology: not harvested report
jadore801120/attention-is-all-you-need-pytorch mentioned on GitHubpytorchSyntology: not harvested report
jingyuanz/keras-self-attention-layer mentioned on GitHubSyntology: not harvested report
kalaivani-s/self-attentive-sent-emb mentioned on GitHubpytorchSyntology: not harvested report
kaushalshetty/Structured-Self-Attention mentioned on GitHubpytorchSyntology: 1 sample, 1 ran (1 instrument-failed) · 0 unverified report
kenkenling/NLP mentioned on GitHubpytorchSyntology: not harvested report
laohur/LearnToCompareText mentioned on GitHubpytorchSyntology: not harvested report
laohur/RelationNet mentioned on GitHubpytorchSyntology: not harvested report
leejieun51/transformer mentioned on GitHubpytorchSyntology: not harvested report
liqichen6688/duo-attention mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
natel9178/transformer-refork mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
paddorch/SelfAttnSent.paddle mentioned on GitHubpaddleApache-2.0Syntology: 2 samples, 2 ran (0 instrument-failed) · 0 unverified report
prakashpandey9/Text-Classification-Pytorch mentioned on GitHubpytorchMITSyntology: not harvested report
roomylee/self-attentive-emb-tf mentioned on GitHubtfMITSyntology: 2 samples, 2 ran (1 instrument-failed) · 0 unverified report
shijx12/AR-Tree mentioned on GitHubpytorchSyntology: not harvested report
simonjisu/nsmc_study mentioned on GitHubpytorchSyntology: not harvested report
text-machine-lab/transformerpy mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
warnikchow/coaudiotext mentioned on GitHubtfMITSyntology: 3 samples, 3 ran (0 instrument-failed) · 0 unverified report
willzli/bilstm_selfattention mentioned on GitHubpytorchSyntology: not harvested report
xalanq/chinese-sentiment-classification mentioned on GitHubpytorchSyntology: not harvested report
yanqi1811/attention-is-all-you-need mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
yueyongjiao/Transformer-Contextual mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified); nothing checks that they implement this paper's method. report
yueyongjiao/attention_is_all_you_need_pytorch mentioned on GitHubpytorchSyntology: not harvested report
yuriak/PPDAI mentioned on GitHubtfSyntology: not harvested report
yyfsXZ/structured_self_attention_sent_embedding mentioned on GitHubtfSyntology: not harvested report
zhangbo2008/best_pytorch_transformer mentioned on GitHubpytorchSyntology: not harvested report
dmlc/gluon-nlp mxnetApache-2.0Syntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to GluonCV and GluonNLP: Deep Learning in Computer Vision and Natural Language Processing (arXiv:1907.04433; that paper's own run record: 1 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

10 samples harvested: 10 ran (of which 0 constructed an object rather than computing a result; 6 with no instrument failure: 0 honoured, 0 violated, 6 with no contract checked; 4 where Syntology's instrument failed) · 0 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

4ran · our draft was wrong
6ran

Licence: 3 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. For 1 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. 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; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

HiJiGOO/self-attentive community (archive-listed) 2 samples, 2 ran (2 instrument-failed) · 0 unverified
string_parser code/self-attentive.py ran · our draft was wrong no licence file found · pointer only · 5e9d3d663b78a270 · report fixture: signature arr:list/1/str, tokenizer:StandInTokenizer/0/?, fit:bool/0/bool · returned tuple · level recorded 2026-09-22
token_parse code/self-attentive.py ran · our draft was wrong no licence file found · pointer only · 39e95d3164e07875 · report fixture: signature iterator:list_iterator/0/? · returned list · level recorded 2026-09-22
kaushalshetty/Structured-Self-Attention community (archive-listed) 1 sample, 1 ran (1 instrument-failed) · 0 unverified
json_to_dict classification.py ran · our draft was wrong MIT (permissive) · ecc1307775a708aa · report fixture: signature json_set:dict/0/? · returned dict · level recorded 2026-09-22
paddorch/SelfAttnSent.paddle community (archive-listed) 2 samples, 2 ran (0 instrument-failed) · 0 unverified
F_score self_attn_sent/utils.py ran Apache-2.0 (permissive) · da3b18d772dc8f1f · report fixture: signature p:dict/0/?, r:dict/0/? · returned dict · level recorded 2026-09-26
precision_recall in 7 papers self_attn_sent/utils.py ran Apache-2.0 (permissive) · c01024271e313d54 · report fixture: signature output:list/1/int, target:list/1/int · returned tuple · level recorded 2026-09-26
roomylee/self-attentive-emb-tf community (archive-listed) 2 samples, 2 ran (1 instrument-failed) · 0 unverified
clean_str in 51 papers data_helpers.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · efe1a86fd9a2468e · report fixture: signature string:str/0/str · returned str · level recorded 2026-09-22
load_data_and_labels data_helpers.py ran MIT (permissive) · 27e5a1edfa3a516d · report fixture: signature path:str/0/str · returned tuple · level recorded 2026-09-26
warnikchow/coaudiotext community (archive-listed) 3 samples, 3 ran (0 instrument-failed) · 0 unverified
cho2onehot han2one.py ran MIT (permissive) · 4f425858112c1b43 · report fixture: signature s:str/0/str · returned ndarray · level recorded 2026-09-26
con2onehot han2one.py ran MIT (permissive) · b4b9fac0046d2067 · report fixture: signature s:str/0/str · returned ndarray · level recorded 2026-09-26
cwu2onehot han2one.py ran MIT (permissive) · 166e995944ac3cdb · report fixture: signature s:str/0/str · returned ndarray · level recorded 2026-09-26

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