Source-linked AI summary
Controlling Linguistic Style Aspects in Neural Language Generation
Jessica Ficler, Yoav Goldberg
TL;DR
The paper addresses limited control over stylistic aspects in neural text generation, beyond content control. It uses a conditioned RNN language model whose context encodes content and style properties, and reports successful control and generalization in movie reviews, with annotation quality as a key limitation.
Problem
Most neural natural language generation work focuses on controlling content, while this paper addresses control of multiple stylistic aspects alongside content.
Method
A conditioned recurrent language model encodes desired content and stylistic property values in a context vector used during generation.
Results
The model learns to associate parameters with the corresponding text properties, generates sentences matching requested values, and generalizes to unseen property combinations.
Takeaways & Limitations
Conditioned language models provide relatively fine-grained control over multiple stylistic aspects in movie-review generation.
Takeaways & Limitations
Training depends on annotations obtained from metadata or specialized heuristics, and review-level sentiment labels are assigned to individual sentences as a known deficiency.
Abstract
from arXiv · showhide
Most work on neural natural language generation (NNLG) focus on controlling the content of the generated text. We experiment with controlling several stylistic aspects of the generated text, in addition to its content. The method is based on conditioned RNN language model, where the desired content as well as the stylistic parameters serve as conditioning contexts. We demonstrate the approach on the movie reviews domain and show that it is successful in generating coherent sentences corresponding to the required linguistic style and content.
1 Introduction
The paper targets neural generation that controls stylistic properties alongside content, using a conditioned language model. It evaluates whether the model learns these controls, improves perplexity, and generalizes to unseen property combinations.
- Motivation and contribution: Different stylistic realizations can convey the same message, motivating explicit control over professional or colloquial, personal or impersonal, and descriptive styles.The introduction illustrates these variations with movie-review sentences of similar length but contrasting voices and adjective usage.
- Motivation and contribution: The framework controls high-level content and multiple stylistic properties in generated text.The style dimensions include length, descriptiveness, personal voice, and professional style, alongside sentiment and topic.
- Method: The model conditions generation on a context vector encoding desired linguistic properties, whose values can be set at test time.Training is fully supervised, with each sentence labeled by the properties used as conditioning contexts.
- Data and scope: Obtaining training annotations is the main challenge; the paper derives them from metadata or specialized text-based heuristics.The authors note that the annotation heuristics may be imperfect.
- Evaluation: The authors report that conditioned generation learns associations between parameters and text behavior, and can generate sentences matching requested values.The evaluation uses generated sentences with different conditioning properties to measure behavioral matching.
- Evaluation: The model generalizes to property combinations not observed during training.This result is reported as part of the evaluation of generated sentences.
2 Task Description and Definition
The task is to generate text compatible with assigned content and stylistic parameter values. In the movie-review domain, the parameter set combines content categories with style controls such as professionalism, voice, length, and descriptiveness.
- Task definition: The goal is to generate text that conveys requested content while conforming to specified stylistic properties.The task represents properties as parameter assignments and seeks compatible generated text.
- Parameters: Each parameter has possible values, and generation is conditioned on a specific assignment across the parameter set.The paper lists parameter values for example assignments in the movie-review domain.
- Examples: Example assignments pair content and style values with sentences intended to realize those combinations.The examples contrast professional and descriptive settings with more colloquial, non-descriptive settings.
- Parameters: Movie-review content is represented by theme and sentiment, while style is represented by professional, personal, length, and descriptive parameters.Theme covers aspects such as plot and acting; descriptive indicates use of many adjectives.
3 Conditioned Language Model
The paper uses a conditioned recurrent language model in which each token depends on prior tokens and a context encoding desired textual properties. The context is supplied throughout generation using concatenated property embeddings.
- Conditioning mechanism: In a conditioned language model, each token depends on preceding tokens and an additional context c.This extends the regular language-model factorization with conditioning information.
- Conditioning mechanism: The model implements conditioning with an RNN language model by concatenating context c with the input at every time step.The context is therefore available throughout sequence generation.
- Design choices: The approach differs from earlier conditioned language-model work by conditioning on many parameters simultaneously.The model uses an LSTM-based language model and Byte Pair Encoding for open-vocabulary representation.
- Conditioning mechanism: The context vector encodes desired textual properties by concatenating an embedding for each parameter value.The resulting vector is fed into the RNN alongside the previous word.
4 Data-set Collection and Annotation
The dataset contains movie-review sentences annotated with six content and stylistic parameters using metadata and text heuristics. These annotations support supervised conditioning but include known heuristic limitations.
- Annotation sources: Annotations come from review metadata when available or from text heuristics based on content words, function words, and part-of-speech distributions.The paper explicitly warns that some heuristics are not tight and annotations may contain noise.
- Dataset: The corpus contains 1,002,625 reviews from 7,500 movies, split into sentences and annotated with four style and two content parameters.The six parameters are professional, personal, descriptive, length, sentiment, and theme.
- Annotation definitions: Professional style is assigned from reviewer status, distinguishing professional critics or super-reviewers from other reviewers.The resulting labels are professional:true or professional:false.
- Annotation definitions: Sentiment labels derive from review grades, with normalized scores 0-2 treated as negative, 3 as neutral, and 4-5 as positive.Reviews without score information receive the none label.
- Annotation definitions: Length is binned into ≤10, 11-20, 21-40, and >40 tokens, while personal voice is detected using personal pronouns or possessives.The personal heuristic labels sentences containing “I” or “my” as personal:true.
- Annotation definitions: Theme is assigned from word lists for plot, acting, production, and effects, with unmatched sentences labeled other.Descriptive text is heuristically identified when at least 35% of part-of-speech tags are adjectives.
- Limitations: Associating review-level sentiment scores with individual sentences is a deficiency that may explain failures observed in evaluation.This limitation applies specifically to the text-derived annotation procedure.
- Dataset: The final dataset has 2,773,435 labeled sentences divided into training, development, and test sets.The reported split sizes are 2,769,138 training, 2,139 development, and 2,158 test sentences.
5 Evaluating Language Model Quality
The evaluation compares conditioned language models with unconditioned and dedicated alternatives using perplexity, then tests sensitivity to conditioning values. Conditioned models generally benefit from the supplied properties, scale better as conditioning factors increase, and distinguish some stylistic dimensions more clearly than others.
- 5.1 Conditioned vs. Unconditioned: Conditioned language models achieve better perplexity when supplied with the correct parameter values than unconditioned models trained on the same data.The evaluation measures language-model quality using test-set perplexity.
- 5.2 Conditioned vs. Dedicated LMs: As conditioning factors increase, dedicated-model training data and modeling quality decrease, while conditioned models generalize across property combinations.The conditioned approach therefore remains effective with many conditioning factors, whereas dedicated models are not scalable in this setting.
- 5.3 Conditioned vs. Flipped Conditioning: Flipping conditioning values causes a substantial increase in perplexity, with the smallest drop for sentiment and the largest for descriptiveness and personal voice.The model distinguishes descriptive text and personal voice better than sentiment and professional text.
6 Evaluating the Generated Sentences
The evaluation tests whether conditioning controls individual properties, including length, descriptiveness, personal voice, theme, sentiment, and professionalism. Results show strong control for several properties, while professional style is harder to assess and occasionally ambiguous.
- Evaluation setup: 3,285 sentences were generated from attested development-set property combinations, with high-scoring outputs distributed according to the development-set property distribution.For each combination, the model generated 1,000 random sentences and selected a frequency-proportional top-k subset.
- Length: Average generated lengths fit the requested ranges, with only 0.2% to 2.6% exceeding the limits by more than 2.The evaluation reports average, minimum, maximum, and deviation measures for requested length values.
- Descriptive style: 85.7% of sentences requested as descriptive met the descriptiveness criterion, while 96% requested as non-descriptive were classified as non-descriptive.Descriptiveness was defined using a heuristic requiring more than 35% adjective tags.
- Professional style: Annotators correctly distinguished professional from non-professional generated sentences in 72.1% of pairs, but some failures reflected genuinely ambiguous style.Each pair was judged by five annotators; some professional outputs were not professional enough, while others could plausibly fit either category.
7 Related Work
Related work has addressed stylistic generation through rule-based systems, statistical paraphrasing, writer conditioning, and neural attribute control. The paper positions its conditioned language model as a simpler approach that scales to natural sentence lengths and multiple stylistic properties.
- Neural generation: Earlier neural generation primarily controlled content, while related work also conditioned generation on speaker identity, politeness, length, and other stylistic factors.Writer or speaker conditioning can capture personal style and dialect, although some work introduced style control indirectly.
- Neural generation: Radford et al. identified a hidden dimension associated with sentiment in an unconditioned LSTM, but the paper describes that post-hoc control method as unreliable.The cited approach fixed a hidden-layer dimension to influence sentiment during generation.
- Positioning: The paper extends prior conditioning approaches by controlling numerous stylistic aspects, combining metadata with heuristically derived properties, and moving beyond machine translation.Its framework conditions generation on multiple properties rather than relying on a single discovered hidden representation.
- Neural attribute control: Hu et al. control sentiment and tense with a VAE and discriminator, whereas this work uses a simpler conditioned LSTM-LM without a dedicated discriminator network.The paper reports that Hu et al. restrict experiments to sentences up to length 16 and two conditioning aspects, while its approach handles natural sentence lengths and six individual aspects.
- Earlier stylistic generation: Pre-neural systems and statistical methods explored stylistic control through rule-based generation, style transfer, formality lexicons, and computational modeling of stylistic properties.The paper describes these methods as related foundations and natural companions to conditioned generation.
8 Conclusions
The paper presents a conditioned NNLG framework for relatively fine-grained stylistic control and demonstrates it in movie reviews. It identifies finer-grained content control as a remaining challenge.
- Conclusion: The framework allows relatively fine-grained control over different stylistic aspects of generated sentences and is demonstrated in the movie-reviews domain.The conclusion characterizes the evaluation as an initial case study.
- Future work: A remaining challenge is to provide finer-grained content control while preserving control over the generated sentence’s style.The proposed future direction includes specifying almost complete sentences or structured facts.
Supplementary Materials
The supplementary setup uses a conditioned LSTM with specified dimensions, optimization settings, temperature-based sampling, and BPE vocabulary encoding.
- Parameters: The conditioned LSTM uses 256-dimensional word embeddings, 20-dimensional parameter values across six controls, and a 376-dimensional RNN input.Its LSTM and MLP hidden layers each have dimension 1024.
- Training: Training uses shuffled mini-batches of 16, Adam optimization for 10 train-set iterations, and development-set perplexity for model selection.
- Generation: During generation, temperature reshapes the softmax distribution; lower values concentrate probability on the highest-reward item, and the study sets τ to 0.6.The next token is randomly sampled from the resulting distribution.
- Vocabulary: BPE encoding represents rare words as subword sequences within a fixed vocabulary, which is decoded back into whole words.The vocabulary size is set to 30,469.
2. Categorization to Themes
The study assigns movie-review sentences to themes by matching words against manually collected category vocabularies, with unmatched sentences assigned to other.
- Theme categories: The theme parameter has five possible values: plot, acting, production, effects, and other.
- Theme categories: The plot vocabulary contains story- and script-related words, while acting covers performers, casting, roles, and performances.
- Theme categories: Production includes directing and production terms, whereas effects includes music, sound, visual, cinematography, and related terms.
- Assignment rule: A sentence receives the theme with the most matched vocabulary words; sentences with no matches are assigned to other.
3. Examples of Generated Sentences
The generated examples pair requested theme, sentiment, audience perspective, length, and descriptiveness settings with varied movie-review sentences.
- Conditioned examples: The parameter settings vary professional and personal perspective controls, including professional false, personal true and professional true, personal false.
- Generated content: Other-theme negative examples express criticism through complaints about originality, boredom, predictability, poor quality, and disappointing endings.
- Generated content: Positive plot-conditioned examples discuss stories and characters, including praise for a story, a twist ending, and complicated characters.
- Conditioned examples: The examples include generated sentences conditioned on acting, other, and plot themes.The displayed examples include multiple parameter configurations for each theme.
- Conditioned examples: Examples span neutral, negative, and positive sentiment settings.
- Conditioned examples: The examples use 11-20-word and 21-40-word length ranges, with descriptive settings both false and true.